T
Tim
Hello,
I'm a xml beginner, buidling an app that translates xml to html using
xmldom/msxml. I could use some help on the following issue. I have an xml
file that contains descriptions of products. For each product a description
entity with an id attribute. Each description element can contain none or
more reference entities. A reference entity specifies a link/reference to
another description entity.
I want my xsl to transform a particular description to a html page (which is
no problem). Additionally I want each reference to be transformed to a <a>
link with in the href the id of the reference entity. The <a> link has to be
positioned at the exact same spot in the text of the description entity as
it has in the original xml file. Can anybody help me with this? Thanks alot
in advance.
Best regards,
Tim
The xml file:
<description id="description1">this is the first description in my xml
document. This is a reference to the <reference target="description2">second
description</reference> in my xml document</description>
<description id="description2">second description</description>
The xsl file:
<xsl:template match="/">
<xsl:apply-templates select="/DESCRIPTION"/>
</xsl:template>
<xsl:template match="DESCRIPTION">
<P>
CONVERT THE CURRENT DESCRIPTION TAG TO <P> TAGS, BUT DISPLAY THE REFERENCES
AS HYPERLINKS IN THE DESCRIPTION TEXT
</P>
</xsl:template>
I'm a xml beginner, buidling an app that translates xml to html using
xmldom/msxml. I could use some help on the following issue. I have an xml
file that contains descriptions of products. For each product a description
entity with an id attribute. Each description element can contain none or
more reference entities. A reference entity specifies a link/reference to
another description entity.
I want my xsl to transform a particular description to a html page (which is
no problem). Additionally I want each reference to be transformed to a <a>
link with in the href the id of the reference entity. The <a> link has to be
positioned at the exact same spot in the text of the description entity as
it has in the original xml file. Can anybody help me with this? Thanks alot
in advance.
Best regards,
Tim
The xml file:
<description id="description1">this is the first description in my xml
document. This is a reference to the <reference target="description2">second
description</reference> in my xml document</description>
<description id="description2">second description</description>
The xsl file:
<xsl:template match="/">
<xsl:apply-templates select="/DESCRIPTION"/>
</xsl:template>
<xsl:template match="DESCRIPTION">
<P>
CONVERT THE CURRENT DESCRIPTION TAG TO <P> TAGS, BUT DISPLAY THE REFERENCES
AS HYPERLINKS IN THE DESCRIPTION TEXT
</P>
</xsl:template>