IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: feiyang
About
User Name: feiyang
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Tuesday, June 24, 2008
Last Visit: Wednesday, April 21, 2010 8:46:06 AM
Number of Posts: 9
[0.05% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Keep CDATA in Output
Posted: Wednesday, April 21, 2010 8:43:25 AM
Thank you for your helpful posting! I will try that.
Topic: node() Knotentest - Attribute
Posted: Thursday, March 4, 2010 12:31:21 PM
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!



Topic: Keep CDATA in Output
Posted: Wednesday, February 3, 2010 12:41:25 PM
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!
Topic: Keeping &quot; escape characters
Posted: Wednesday, February 3, 2010 12:39:38 PM
Thank you very much for this helpful answer. I will try this.
Topic: Keeping &quot; escape characters
Posted: Wednesday, January 20, 2010 9:39:11 PM
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.
Topic: xsl:template: Output contains all elements
Posted: Wednesday, October 14, 2009 5:55:21 PM
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?
Topic: xsl:template: Output contains all elements
Posted: Wednesday, October 14, 2009 12:24:47 AM
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
Topic: XSD to check whether Elements are "not null"
Posted: Wednesday, June 25, 2008 10:16:04 AM
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!

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.