Re: [xslt] Using XSLT as a query engine




Please disregard question #1.  My error.




"Dave Guerrieri" <Dave_Guerrieri@jepplg.com> on 03/22/2002 09:05:45 AM

Please respond to xslt@gnome.org

To:   xslt@gnome.org
cc:    (bcc: Dave Guerrieri/Jeppesen/TMC)

Subject:  [xslt] Using XSLT as a query engine





I have created a large XML File (2.6 MB) and would like to query it to find the
element with a particular attribute.  The attribute is unique in the file.  I
have also created the following XSLT file:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:param name="param1"/>
<xsl:param name="param2"/>

<xsl:key name="Id-key" match="/DocRoot/Element" use="@id"/>
<xsl:template match="/">
   <xsl:copy-of select="key('Id-key',$param1)"/>
   <xsl:copy-of select="key('Id-key',$param2)"/>
</xsl:template>

</xsl:stylesheet>


I have two questions:

1) I must be misunderstanding how to use xsl:copy-of because only the element
with the id attribute matching $param1 is output.

2)Can I tell libxslt to build the key only once so I can apply the stylesheet
with new parameters and not have to take the performance hit to rebuild the key
for an unchanged document?

Thank you very much for this excellent library!


_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
xslt@gnome.org
http://mail.gnome.org/mailman/listinfo/xslt









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]