Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 14th, 2008, 05:41 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old May 14th, 2008, 06:04 AM
samjudson's Avatar
Friend of Wrox
Points: 8,436, Level: 39
Points: 8,436, Level: 39 Points: 8,436, Level: 39 Points: 8,436, Level: 39
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,084
Thanks: 1
Thanked 180 Times in 179 Posts
Default

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 -/
Reply With Quote
  #3 (permalink)  
Old May 14th, 2008, 06:25 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old May 14th, 2008, 06:29 AM
mhkay's Avatar
Wrox Author
Points: 17,731, Level: 57
Points: 17,731, Level: 57 Points: 17,731, Level: 57 Points: 17,731, Level: 57
Activity: 77%
Activity: 77% Activity: 77% Activity: 77%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,833
Thanks: 0
Thanked 266 Times in 261 Posts
Default

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
Reply With Quote
  #5 (permalink)  
Old May 14th, 2008, 08:12 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found out that XML DOM is used for parsing the xml and xslt transformation.
Is that of any help?

Reply With Quote
  #6 (permalink)  
Old May 14th, 2008, 08:21 AM
mhkay's Avatar
Wrox Author
Points: 17,731, Level: 57
Points: 17,731, Level: 57 Points: 17,731, Level: 57 Points: 17,731, Level: 57
Activity: 77%
Activity: 77% Activity: 77% Activity: 77%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,833
Thanks: 0
Thanked 266 Times in 261 Posts
Default

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
Reply With Quote
  #7 (permalink)  
Old May 15th, 2008, 12:03 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #8 (permalink)  
Old May 15th, 2008, 02:19 AM
joefawcett's Avatar
Wrox Author
Points: 9,712, Level: 42
Points: 9,712, Level: 42 Points: 9,712, Level: 42 Points: 9,712, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,066
Thanks: 1
Thanked 36 Times in 35 Posts
Default

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)
Reply With Quote
  #9 (permalink)  
Old May 15th, 2008, 03:20 AM
mhkay's Avatar
Wrox Author
Points: 17,731, Level: 57
Points: 17,731, Level: 57 Points: 17,731, Level: 57 Points: 17,731, Level: 57
Activity: 77%
Activity: 77% Activity: 77% Activity: 77%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,833
Thanks: 0
Thanked 266 Times in 261 Posts
Default

>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
Reply With Quote
  #10 (permalink)  
Old May 15th, 2008, 03:58 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
xml declaration chroniclemaster1 XML 0 September 20th, 2007 02:00 PM
xml displayed in textbox GS C# 2005 1 August 31st, 2007 12:45 PM
omit-xml-declaration dextermagnific XSLT 3 August 4th, 2006 09:55 AM
XML to be displayed in a pop-up crmpicco Classic ASP Basics 1 February 10th, 2005 08:19 AM
Create XML Doc with Stylesheet Declaration rodmcleay General .NET 1 November 15th, 2004 03:11 AM



All times are GMT -4. The time now is 03:08 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.