Re: Editing XML
- From: Hans-Peter Diettrich <DrDiettrich1@xxxxxxx>
- Date: Mon, 11 Jun 2007 17:32:41 +0200
Maarten Wiltink wrote:
To transform
<MSHelp:link keywords="***">click here</MSHelp:link>
into
<a href="html/***.htm">click here</a>,
something like
<xsl:template match="MSHelp:link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>html/</xsl:text>
<xsl:value-of select="@keywords" />
<xsl:text>.htm</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*|text()" /> <!-- exclude @* -->
</xsl:element>
</xsl:template>
Not tested.
Thanks, now I have some hints on where to start looking into XSLT :-)
> <xsl:apply-templates select="*|text()" /> <!-- exclude @* -->
Does here "@" refer to (all?) attributes, "*" to all childnodes, and text() to the text? The members of the elements (or nodes?) still are somewhat unclear to me :-(
Also I didn't understand the difference between XMLDoc.DocumentElement, ..Node and .ChildNodes. Is .Node the very root node of the document, whose children are the .ChildNodes, and .DocumentElement is one of these children? There also seems to exist a flat list of all elements or nodes in a document?
DoDi
.
- Follow-Ups:
- Re: Editing XML
- From: Maarten Wiltink
- Re: Editing XML
- References:
- Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Maarten Wiltink
- Editing XML
- Prev by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Next by Date: Never publish before you have tested !
- Previous by thread: Re: Editing XML
- Next by thread: Re: Editing XML
- Index(es):