|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [ ? ] Ignoring redundancy
I am in the process of writing a style-sheet that handles "depends-on"
relationships between XML represented objects. The XML looks something
like:
...
<my-variable name="greeting"><body>'Hey there, '</body></my-var>
<my-variable name="who"><body>'J. User'</body></my-var>
<my-subroutine name="annoy">
<require>greeting</require>
<require>who</require>
<args>
<arg name="g"/>
<arg name="w"/>
</args>
<body><![CDATA[
return (g ? g : greeting) + (w ? w : who) + '!';
]]></body>
</my-subroutine>
...
The "depends-on" relationship is handled by an XSLT template like so:
<xsl:template match="require">
<xsl:variable name="r" select="."/>
<xsl:apply-templates
select="/*/my-variable[@name=$r] | /*/my-subroutine[@name=$r]"/>
</xsl:template>
A problem arises when two objects have one or more "depends-on"
relationships in common because the required object(s) will be included
twice. Is there a way to determine when a required object has already
been included?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart


![[ ? ] Ignoring redundancy](/images/get_stylus.gif)





