 |
| XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 14th, 2008, 05:41 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
xml declaration not displayed
Hi All,
Iam using Message designer to create xgm map. I have written an xslt that is linked to the xgm map. In the output xml ,Iam not getting the xml declaration even though I have set the omit-xml-declaration option to 'no'. below is the stmt Iam using
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
Please help.
Thanks
Sheema
|
|

May 14th, 2008, 06:04 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Often the XSLT processor you are using will have an effect on whether the XML declaration is output or not.
I can't tell from your post which XSLT processor you are using?
/- Sam Judson : Wrox Technical Editor -/
|
|

May 14th, 2008, 06:25 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Sam,
Thanks for the reply.
how to know about the xslt processor. The Message Designer tool has an option to link the xslt to an xgm map. Iam simply using it. I have no idea about xslt processor.
Is there any way to know/ specify it ourselves?
below is the whole xslt code
<?xml version="1.0" encoding="UTF-8"?>
<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" omit-xml-declaration="no"/>
<xsl:template match="/">
<xsl:apply-templates mode="copy"/>
</xsl:template>
<xsl:template match="@*|node()" mode="copy">
<xsl:if test="normalize-space(.)">
<xsl:copy>
<xsl:apply-templates select="@*|node()"
mode="copy"/>
</xsl:copy>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
this code is to remove the empty tags from the xml.
I dont have much knowledge about xml/xslt. Please let me know how to proceed.
Thanks,
Sheema
|
|

May 14th, 2008, 06:29 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
If xsl:output appears to have no effect, the reason is often that the XML output isn't being serialized by the XSLT processor, but by some other piece of software (for example, the DOM serializer). We need to know more about your processing environment. I'm afraid "Message designer" and "xgm" aren't terms that ring any bells.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

May 14th, 2008, 08:12 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I found out that XML DOM is used for parsing the xml and xslt transformation.
Is that of any help?
|
|

May 14th, 2008, 08:21 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I think you will need to find a forum where you can ask about the specific technologies you are using.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

May 15th, 2008, 12:03 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok..will do that...
I have another question...
when I use CDATA, '<' is outputted as #60;
Iam using UTF-8 encoding.
Can anyone help me out with this..
Thanks,
Sheema
|
|

May 15th, 2008, 02:19 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
Try the following stylesheet to see what processor you are using:
Code:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
<html>
<body>
<p>
Version:
<xsl:value-of select="system-property('xsl:version')" />
<br />
Vendor:
<xsl:value-of select="system-property('xsl:vendor')" />
<br />
Vendor URL:
<xsl:value-of select="system-property('xsl:vendor-url')" />
</p>
</body>
</html>
</xsl:template></xsl:stylesheet>
--
Joe ( Microsoft MVP - XML)
|
|

May 15th, 2008, 03:20 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
>when I use CDATA, '<' is outputted as #60;
Since we have no idea what serialization technology you are using, it's going to be hard to answer your questions.
But what do you mean anyway by saying "when I use CDATA"? And are you talking about a "<" that's part of the markupl, or part of the data?
You aren't making it very easy for people to help you. Please try to say exactly what you did and exactly what happened.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

May 15th, 2008, 03:58 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the stylesheet...
from the stylesheet provided, I got the below result :
<html>
<body>
<p>
Version:
1<br/>
Vendor:
Oracle Corporation.<br/>
Vendor URL:
http://www.oracle.com</p>
</body>
</html>
any comments?
|
|
 |