Hi,
Tom Amiro wrote:
> Hi Robert,
>
> Check out
>
> http://xml.apache.org/xalan-j/xsltc/xsltc_performance.html
>
> That may give you some insight.
>
Yes, but not exactly. I currently use ALOT of keys (VERY common in
XSLT). The results Jacek posted on cocoon-dev have made me want to look
at switching to XSLTC
Can you suggest the best way to handle a situation I have? The XML
structure is a hierarchical representation of a site. There are folders
and pages. An XML content piece can be assigned at the folder level to
cascade down to all pages in the folder or a content piece can be
assigned at the page level. The content pieces just have IDs pointing to
a node in a separate 'content.xml' config document [XML below] so the
pieces can be reused easily.
Say I want to find the active page nodeset and put it in a variable. Is
this the best way to identify a page with XSLTC?
<xsl:variable
name="active_nodeset"
select="//page[@id=$id]"/>
I find the page, then I need to find the representation in content.xml
[below]. Is this the best way?
<xsl:variable
name="xml_nodeset"
select="document('content.xml')//xml[@id=$active_nodeset/@id]"/>
thanks,
-Rob
---------------------------------------------------------------------
Stripped down example:
--- site.xml ----
<config>
<folder id="f0000000001">
<col type="narrow_left"/>
<col type="wide_center"/>
<col type="narrow_right"/>
<page id="p0000000001">
<col type="narrow_left"/>
<col type="wide_center">
<xml id="index_en.xml"/>
</col>
<col type="narrow_right"/>
</page>
<folder id="f742372637">
<col type="narrow_left"/>
<col type="wide_center"/>
<col type="narrow_right">
<xml id="c242640179.xml"/>
</col>
<page id="p268675785">
<col type="narrow_left"/>
<col type="wide_center">
<xml id="c1602691198.xml"/>
</col>
<col type="narrow_right"/>
</page>
<folder id="f28737725">
<col type="narrow_left"/>
<col type="wide_center"/>
<col type="narrow_right"/>
<page id="p1284141096">
<col type="narrow_left"/>
<col type="wide_center"/>
<col type="narrow_right"/>
</page>
</folder>
</folder>
</folder>
</config>
=================================
--- content.xml ---
<config>
<content id="f0000000001" owner="rk123">
<xml label="Main Home page" id="index_en.xml" owner="default"/>
<content id="f742372637" owner="rk123">
<xml label="boop" id="c1602691198.xml" owner="default"/>
<xml label="hjhjhjhjh" id="c242640179.xml" owner="default"/>
<content id="f28737725" owner="rk123">
<xml label="scoobie" id="c366915042.xml" owner="default"/>
</content>
</content>
</content>
</config>