xslt - BaseX: where to declare the XML document on which to perform a query -
with programme basex able utilize xpath , xquery in order query xml document located @ home directory, have problem doing same in xslt.
the document i'm querying bookstoreq.xml.
xpath version, running totally fine:
doc("/home/ioannis/desktop/bookstoreq.xml")/bookstore/book/title
xslt code want execute:
<xsl:stylesheet version = "2.0" xmlns:xsl = "http://www.w3.org/1999/xsl/transform"> <xsl:output method= "xml" indent = "yes" omit-xml-declaration = "yes" /> <xsl:template match = "book"></xsl:template> </xsl:stylesheet>
i read basex' documentation on xslt, didn't manage find solution. how can run given xslt?
basex has no direct back upwards xslt, have phone call using xquery functions (which easy, though). there 2 functions doing this, 1 returning xml nodes (xslt:transform(...)
), 1 returning text string (xslt:transform-text(...)
). need sec one.
xslt:transform-text(doc("/home/ioannis/desktop/bookstoreq.xml"), <xsl:stylesheet version = "2.0" xmlns:xsl = "http://www.w3.org/1999/xsl/transform"> <xsl:output method= "xml" indent = "yes" omit-xml-declaration = "yes" /> <xsl:template match = "book"></xsl:template> </xsl:stylesheet> )
both can either called xslt nodes (used here), passing string or giving path file containing xslt code.
xslt xquery basex
No comments:
Post a Comment