Re: Editing XML
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Jun 2007 12:22:13 +0200
"Hans-Peter Diettrich" <DrDiettrich1@xxxxxxx> wrote in message
news:5d4eu7F32vbnhU3@xxxxxxxxxxxxxxxxxxxxx
Rob Kennedy wrote:
<xsl:template match="MSHelp:link">
<xsl:element name="a">
<xsl:copy-of select="@*"/>
How should this read, in order to translate the keywords="..." into a
href="html/...htm" attribute, dropping all other attributes?
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.
To perform the transformation, I used Ant, the Java build tool,
because that's the only way I know how to invoke XSL transformations.
You can download Saxon. Or Xalan. Or the MS XML SDK, which appears to
include the MSXSL utility.
Hmmm, a transformation should be made whenever my browser has to show a
help page. Unless there exists a simpler programmatic way of invoking
the script, I'll stick with cloning the nodes.
Put <?xml-style*** type="text/xsl" href="whatever.xslt" ?> near the top
of your XML documents. That should make the client run the transformation
'whatever.xslt' on the document. Meaning lots of things can still go
wrong.
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Hans-Peter Diettrich
- 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
- Editing XML
- Prev by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Next by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Previous by thread: Re: Editing XML
- Next by thread: Re: Editing XML
- Index(es):