My goal is to merge an XHTML document that is acting like a template with peices from several XML documents. I'm open to any approach.
My current strategy is having an <insert> tag in the XHTML whereever the merge is to occur; for instance,
lots of xhtml code to keep
<insert href="contacts.xml" xpath="//contact[@id='bob']" />
more xhtml code to keep
When encountering the <insert> tag, I do something like
<xsl:apply-templates select="document(@href)/@xpath" />
Where @xpath should be the contents of the attribute, not the "@xpath" itself. This is akin to a Javascript eval(@xpath).
Can it be done in XSLT?
My current strategy is having an <insert> tag in the XHTML whereever the merge is to occur; for instance,
lots of xhtml code to keep
<insert href="contacts.xml" xpath="//contact[@id='bob']" />
more xhtml code to keep
When encountering the <insert> tag, I do something like
<xsl:apply-templates select="document(@href)/@xpath" />
Where @xpath should be the contents of the attribute, not the "@xpath" itself. This is akin to a Javascript eval(@xpath).
Can it be done in XSLT?