[Home] [By Thread] [By Date] [Recent Entries]
Hmm, a little misunderstanding perhaps....
XML is used for the data. There are two versions current of XML, which are 1.0 and 1.1. Unless for some corner cases, XML 1.0 is usually enough for your needs. XPath is a different standard and is often used in conjunction with XSLT. You mention a link to the specs of XPath 1.0. Do you mean you can only use XPath, or can u also use XSLT? If so, what version? There is a huge difference between solutions in XSLT/XPath 1.0 and 2.0. Also, if you can only use XPath and not XSLT, the solution will be quite different. In you OP you don't specify what "aligning" means to you. Maybe it is easy (i.e., the same start tracks). Probably it is easy in XSLT (because it seems to be about transforming XML to XML and often that is easiest in XSLT), but whether it will be easy or hard and whether you better use 1.0 or 2.0 depends on your problem description, of course. You talk of adding an element to the tree. That sounds like a copy idiom to me. That's easy (but not necessarily so if it is your first attempt with xslt), something like this: <xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*" />
</xsl:copy>
</xsl:template><!-- aligned tracks, meaning: following items have equal starts (???) --> <xsl:template match="track[following-sibling::track[1]/@start = @start]"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> <!-- add extra track --> <track aligned-index1="{@index}" aligned-index2="{following-sibling::track[1]/@index}" /> </xsl:template> The above works in both XSLT 1.0 and 2.0. However it is likely that this is not an answer to your (yet) unspecified question ;) Cheers, -- Abel Braaksma Rodrigo Segnini wrote: Hi Justin,
|

Cart



