| feiyang |
| Newbie |
|
|
|
|
| None Specified |
|
| Tuesday, June 24, 2008 |
| Wednesday, April 21, 2010 8:46:06 AM |
9 [0.05% of all post / 0.00 posts per day] |
|
|
Thank you for your helpful posting! I will try that.
|
Hallo Experten,
Ich habe gelesen, dass der Knotentest node() alle Knotentypen umfasst, also auch Attributknoten.
Wenn ich aber nun folgendes XSLT Stylesheet verwende, werden Attributknoten NICHT kopiert, dies erreiche ich zwar mit der Vereinigungsmenge (node()|@*) aber trotzdem würde mich interessieren, warum bei alleiniger Verwendung von node() die Attribute nicht mitkopiert werden. Ich bin davon ausgegangen, dass ein match auf node() auch für Attributwerte gültig ist. Weiss jemand von Euch mehr?
Hier der XSLT Ausschnitt:
<xsl:template match = "/"> <xsl:apply-templates/> </xsl:template>
<xsl:template match="node()"> <xsl:copy> <xsl:apply-templates select="node()"/> </xsl:copy> </xsl:template>
Danke!
|
Hello,
I have a input file with some CDATA element values. However if I use xsl:copy-of to copy all element CDATA is removed and just the values are copied into the target nodes.
Is there any way to get a 1:1 copy keeping those CDATA values?
Thank you!
|
|
Thank you very much for this helpful answer. I will try this.
|
Hello,
I have a strange issue using my XSLT.
The source message already contains escape characters such as & lt, & gt and & quot.
Now the strange thing is that in the output message & quot is converted back to ' but the other escape characters stay the same.
How is it possible to keep & quot; too in the output?
Thank you very much for your help.
|
Great! Thank you very much for that helpful advise which actually solved my issue. Is this normal behavior of an XSLT processor or just a special feature of XMLSpy when running XSLT stylesheets? Is there any way to deactivate those built in templates?
|
Hello,
currently I am stuck with the following strange behavior of an XSL Transformation in XMLSpy. I use a simplified example to illustrate the issue. When using the template statement I would expect that only the value of the subelement <lastName> is used as output. However the values for "FirstElement" and "SecondElement" are written to the output too (outside of an element tag, marked bold in the output structure). My real XML file contains more than 100 elements on subnode level and I want to avoid typing the whole path for each select statement, so I would like to use the template statement to set the context to a lower level. Obviously this does not work as expected. When debugging I have seen that a "built in template" is used too. Could this be the reason? How can I avoid that behavior? Thank you very much for your advice!
Source XML:
<exampleXML> <name> <firstName>myFirstName</firstName> <lastName>myLastName</lastName> </name> <otherElements> <Element1>FirstElement</Element1> <Element2>SecondElement</Element2> </otherElements> </exampleXML>
XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/exampleXML/name"> <output><xsl:value-of select="firstName"/></output> </xsl:template> </xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?><output>myFirstName</output>FirstElementSecondElement
|
Hello,
I have just created an XSD file that should check the presence of some elements and also whether they have a value. This means that an element with no content like <testElement></testElement> should not be regarded as valid. Therefore I have set the attribute "nillable" in the XSD for this element to "false". When I run a validation in XMLSpy the XML document however is regarded as valid. What could be the reason for this?
Thank you for your help!
|
|