P
Petra Meier
Hi, I hope this is a proper place to post
This is my XML file:
<?xml version="1.0" encoding="utf-8"?>
<foo>
<address>a lot of tags and text</address>
<hubid>a lot of tags and text</hubid>
<thestamps>
<stamp name="A1">bla</stamp>
<stamp name="A2">foo</stamp>
<stamp name="A3">muh</stamp>
<sub type="1">
<stamp name="B1">aaa</stamp>
<stamp name="B2">bbb</stamp>
<stamp name="B3">ccc</stamp>
</sub>
</thestamps>
</foo>
I have to extract all elements with tag name STAMP in that form
(without the ---- doc... ----):
---- document begin ----
A1 ... bla
A2 ... foo
A3 ... muh
B1 ... aaa
B2 ... bbb
B3 ... ccc
---- document end ----
this would be my XsL file
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xslutput method="html"/>
<xsl:template match="address"></xsl:template>
<xsl:template match="hubid"></xsl:template>
<xsl:template match="stamp[@name]">
<xsl:value-of select="@name"/>
<xsl:text> ... </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
I dont think this is very elegant and might be errorprone .. can you
do this better?
thank you so much
Petra
This is my XML file:
<?xml version="1.0" encoding="utf-8"?>
<foo>
<address>a lot of tags and text</address>
<hubid>a lot of tags and text</hubid>
<thestamps>
<stamp name="A1">bla</stamp>
<stamp name="A2">foo</stamp>
<stamp name="A3">muh</stamp>
<sub type="1">
<stamp name="B1">aaa</stamp>
<stamp name="B2">bbb</stamp>
<stamp name="B3">ccc</stamp>
</sub>
</thestamps>
</foo>
I have to extract all elements with tag name STAMP in that form
(without the ---- doc... ----):
---- document begin ----
A1 ... bla
A2 ... foo
A3 ... muh
B1 ... aaa
B2 ... bbb
B3 ... ccc
---- document end ----
this would be my XsL file
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xslutput method="html"/>
<xsl:template match="address"></xsl:template>
<xsl:template match="hubid"></xsl:template>
<xsl:template match="stamp[@name]">
<xsl:value-of select="@name"/>
<xsl:text> ... </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
I dont think this is very elegant and might be errorprone .. can you
do this better?
thank you so much
Petra