Der folgende Beitrag wurde am 08. 09. 2008, 09:57 Uhr von pices veröffentlicht.
hallo thomas ,
letzte Woche am Mittwoch hast du mich geantwortet.War leider nicht da.
Heute habe ich deine Antwort gesehen un versucht , fonctioniert immer nicht weil meine xml-datei anders strukturiert ist:
Die ist so:<?xml version="1.0" encoding="ISO-8859-1"?> und ich will nur die <dig:instances>copieren und die mit attribute"id" =1, 2,3 und so weiter haben.(wie du schon gemacht hast)
<data>
<dataquery>
<dig:instances xmlns:dig="http://www.dig.org">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:ActionWithSuccessor"/>
</dig:instances>
</dataquery>
<dataquery>
<dig:instances xmlns:dig="http://www.dig.org">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
</dig:instances>
</dataquery>
<dataquery>
<dig:instances xmlns:dig="http://www.dig.org">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
</dig:instances>
</dataquery>
.....
<xsl:text>------</xsl:text>
...
</data>
Wie gehe ich jetzt vor.
Gruß,
pices
Der folgende Beitrag wurde am 08. 09. 2008, 10:05 Uhr von pices veröffentlicht.
> hallo thomas ,
> letzte Woche am Mittwoch hast du mich geantwortet.War leider nicht da.
> Heute habe ich deine Antwort gesehen un versucht , fonctioniert immer nicht weil meine xml-datei anders strukturiert ist:
> Die ist so:
>
> <?xml version="1.0" encoding="ISO-8859-1"?> und ich will nur die <dig:instances>copieren und die mit attribute"id" =1, 2,3 und so weiter haben.(wie du schon gemacht hast)
> <data>
> <dataquery>
> <dig:instances xmlns:dig="http://www.dig.org">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:ActionWithSuccessor"/>
> </dig:instances>
> </dataquery>
> <dataquery>
> <dig:instances xmlns:dig="http://www.dig.org">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> </dig:instances>
> </dataquery>
> <dataquery>
> <dig:instances xmlns:dig="http://www.dig.org">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> </dig:instances>
> </dataquery>
> .....
> <xsl:text>------</xsl:text>
> ...
> </data>
>
>
> Wie gehe ich jetzt vor.
>
> Gruß,
> pices
Gut thomas hat geklappt danke. ich habe nur die node berucksichtigt und es hat geklappt.
Bis bald bestimmt.
Der folgende Beitrag wurde am 08. 09. 2008, 10:12 Uhr von Thomas J.S. veröffentlicht.
Hallo,
> Gut thomas hat geklappt danke. ich habe nur die node berucksichtigt und es hat geklappt.
>
Bestens!
> Bis bald bestimmt.
6 min. reaktionszeit. Auch schön ;-)
Grüße
Thomas
Der folgende Beitrag wurde am 08. 09. 2008, 10:42 Uhr von pices veröffentlicht.
> Hallo,
>
> > Gut thomas hat geklappt danke. ich habe nur die node berucksichtigt und es hat geklappt.
> >
>
> Bestens!
>
>
> > Bis bald bestimmt.
>
> 6 min. reaktionszeit. Auch schön ;-)
>
>
> Grüße
> Thomas
Hallo, ich glaube ich habe schnell houha gesagt.ich kriege die "id" bei "<dataquery>" und nicht <dig:instances> was soll ich ergänzen?
XSLT- datei<xsl:template match="dataquery">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="id"><xsl:value-of select="position()"/></xsl:attribute>
<xsl:copy-of select="*"/>
</xsl:copy>
</xsl:template>
Der folgende Beitrag wurde am 08. 09. 2008, 11:02 Uhr von Thomas J.S. veröffentlicht.
Hallo,
> Hallo, ich glaube ich habe schnell houha gesagt.ich kriege die "id" bei "<dataquery>" und nicht <dig:instances> was soll ich ergänzen?
Ausgehend von deinem XML aus deinem ersten Posting:
Grüße
Thomas
----------- xslt -------------<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dig="http://www.dig.org">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/data">
<data>
<xsl:for-each select="dataquery">
<xsl:variable name="DQPos" select="position()" />
<dataquery>
<xsl:for-each select="dig:*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="id">
<xsl:value-of select="$DQPos"/>
</xsl:attribute>
<xsl:copy-of select="*"/>
</xsl:copy>
</xsl:for-each>
</dataquery>
</xsl:for-each>
</data>
</xsl:template>
</xsl:stylesheet>
-------- Ausgabe ---------
[code lang=xml
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns:dig="http://www.dig.org">
<dataquery>
<dig:instances id="1">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:ActionWithSuccessor"/>
</dig:instances>
</dataquery>
<dataquery>
<dig:instances id="2">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
</dig:instances>
</dataquery>
<dataquery>
<dig:instances id="3">
<dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
</dig:instances>
</dataquery>
</data>[/code]
Der folgende Beitrag wurde am 08. 09. 2008, 11:31 Uhr von pices veröffentlicht.
> Hallo,
>
> > Hallo, ich glaube ich habe schnell houha gesagt.ich kriege die "id" bei "<dataquery>" und nicht <dig:instances> was soll ich ergänzen?
>
> Ausgehend von deinem XML aus deinem ersten Posting:
>
> Grüße
> Thomas
>
> ----------- xslt -------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dig="http://www.dig.org">
> <xsl:output method="xml" indent="yes"/>
> <xsl:template match="/data">
> <data>
> <xsl:for-each select="dataquery">
> <xsl:variable name="DQPos" select="position()" />
> <dataquery>
> <xsl:for-each select="dig:*">
> <xsl:copy>
> <xsl:copy-of select="@*"/>
> <xsl:attribute name="id">
> <xsl:value-of select="$DQPos"/>
> </xsl:attribute>
> <xsl:copy-of select="*"/>
> </xsl:copy>
> </xsl:for-each>
> </dataquery>
> </xsl:for-each>
> </data>
> </xsl:template>
> </xsl:stylesheet>
>
> -------- Ausgabe ---------
> [code lang=xml
> <?xml version="1.0" encoding="UTF-8"?>
> <data xmlns:dig="http://www.dig.org">
> <dataquery>
> <dig:instances id="1">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:ActionWithSuccessor"/>
> </dig:instances>
> </dataquery>
> <dataquery>
> <dig:instances id="2">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> </dig:instances>
> </dataquery>
> <dataquery>
> <dig:instances id="3">
> <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> </dig:instances>
> </dataquery>
> </data>[/code]
Hi ,
ich kriege eine fehlermeldung wenn ich mit den prozessor arbeite:"XTDE0410: Cannot create an attribute node after creating a child of the containing element" und mit meine Editor kommt gar nichts raus
Der folgende Beitrag wurde am 08. 09. 2008, 11:48 Uhr von pices veröffentlicht.
> > Hallo,
> >
> > > Hallo, ich glaube ich habe schnell houha gesagt.ich kriege die "id" bei "<dataquery>" und nicht <dig:instances> was soll ich ergänzen?
> >
> > Ausgehend von deinem XML aus deinem ersten Posting:
> >
> > Grüße
> > Thomas
> >
> > ----------- xslt -------------
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dig="http://www.dig.org">
> > <xsl:output method="xml" indent="yes"/>
> > <xsl:template match="/data">
> > <data>
> > <xsl:for-each select="dataquery">
> > <xsl:variable name="DQPos" select="position()" />
> > <dataquery>
> > <xsl:for-each select="dig:*">
> > <xsl:copy>
> > <xsl:copy-of select="@*"/>
> > <xsl:attribute name="id">
> > <xsl:value-of select="$DQPos"/>
> > </xsl:attribute>
> > <xsl:copy-of select="*"/>
> > </xsl:copy>
> > </xsl:for-each>
> > </dataquery>
> > </xsl:for-each>
> > </data>
> > </xsl:template>
> > </xsl:stylesheet>
> >
> > -------- Ausgabe ---------
> > [code lang=xml
> > <?xml version="1.0" encoding="UTF-8"?>
> > <data xmlns:dig="http://www.dig.org">
> > <dataquery>
> > <dig:instances id="1">
> > <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:ActionWithSuccessor"/>
> > </dig:instances>
> > </dataquery>
> > <dataquery>
> > <dig:instances id="2">
> > <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> > </dig:instances>
> > </dataquery>
> > <dataquery>
> > <dig:instances id="3">
> > <dig:catom xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="meta:Action"/>
> > </dig:instances>
> > </dataquery>
> > </data>[/code]
>
> Hi ,
> ich kriege eine fehlermeldung wenn ich mit den prozessor arbeite:"XTDE0410: Cannot create an attribute node after creating a child of the containing element" und mit meine Editor kommt gar nichts raus
>
dieses mal geschafft!!!
danke nochmals Thomas
© 1998-2013 SELFHTMLImpressumSoftware: Classic Forum 3.4