Menu

#7 Need examples of XSLT Queries

open
5
2006-02-25
2006-02-25
Jason Dagit
No

Hello,

I'm using dbXML 2.0. I have many Documents of the
following format:

<?xml version="1.0" encoding="UTF-8"?>
<foo i="4" type="local" z="23">
<record id="0" size="22" />
<date day="22" month="8" year="2005" />
<timetag hour="0" minute="0" />
</foo>

I created an test xsl file as follows and imported it
as a style sheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:strip-space elements="*" />

<xsl:template match="date">
<xsl:value-of select="@day"/>,<xsl:text/>
<xsl:value-of select="@month"/>,<xsl:text/>
<xsl:value-of select="@year"/>
</xsl:template>

</xsl:stylesheet>

I tested my xsl file using a command line xsl processor.

I fire up Administrator, select one of the above
documents to make sure the database knows where I want
to preform my queries. Then I enter the following XSLT
Query:

<dbxml:xslt xmlns:dbxml="http://www.dbxml.com/db/query">
<dbxml:source xpath="/foo" document="">
<!-- optionally source XML -->
</dbxml:source>
<dbxml:params>
<!-- <param name="" value=""> -->
</dbxml:params>
<dbxml:stylesheet document="foo.xsl">
<!-- optionally a stylesheet -->
</dbxml:stylesheet>
</dbxml:xslt>

I get the error message:
com.dbxml.util.dbXMLException: Error Parsing XSLT Query
Couldn't compile XSLT Query
The input node can not be null for a DOMSource for
newTemplates!

I've spent some time googling for this error but I
cannot find anything which helps me fix my XSLT.

Any ideas? Could you possible provide a complete
example of how to do this or point me such an example?

Thanks!

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.