Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
I forgot my password
Register Now
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, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2009, 12:31 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: Ennis, Clare, Ireland.
Posts: 126
Thanks: 7
Thanked 0 Times in 0 Posts
Default Incorrect Namespace output

Hi,

I am referencing the following namespaces in the top of my XSLT and am having difficulty getting the correct output further into my code.

XSLT NS references
Code:
 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msg="http://schemas.microsoft.com/dynamics/2006/02/documents/Message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:si="http://schemas.microsoft.com/dynamics/2006/02/documents/SalesInvoice" xmlns:js-function="//CALjs-functions">
My XSLT transformation code is:
Code:
 
<xsl:element name="InvoiceHeader">
<xsl:attribute name="fo:noNamespaceSchemaLocation"><xsl:text>http://www.w3.org/1999/XSL/Format</xsl:text></xsl:attribute>

...
...
...
 
</xsl:element>
The required output is:
Code:
<InvoiceHeader xmlns:fo="http://www.w3.org/1999/XSL/Format"
/>
But I'm getting:
Code:
<InvoiceHeader xmlns:fo="http://www.w3.org/1999/XSL/Format" fo:noNamespaceSchemaLocation="http://www.w3.org/1999/XSL/Format"/>


Can anyone help please?

Thanks in advance,
__________________
Neal

A Northern Soul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old May 27th, 2009, 12:50 PM
mhkay's Avatar
Wrox Author
Points: 15,993, Level: 54
Points: 15,993, Level: 54 Points: 15,993, Level: 54 Points: 15,993, Level: 54
Activity: 56%
Activity: 56% Activity: 56% Activity: 56%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,532
Thanks: 0
Thanked 197 Times in 194 Posts
Default

First I suggest you use literal result elements rather than xsl:element. Then you just need to write:

<InvoiceHeader>

so long as you add exclude-result-prefixes="msg si" (for example) to the xsl:stylesheet element, listing all prefixes that you have declared but do not want to appear in the output.

I'm afraid I'm at a complete loss to understand why you thought that outputting an attribute with name fo:noNamespaceSchemaLocation would not cause an attribute of that name to be output.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect syntax near '.' meraj ADO.NET 6 February 27th, 2012 12:01 AM
Need to convert an existing namespace and add new namespace to the SOAP xml Prabeen XSLT 10 April 28th, 2009 10:18 AM
Namespace Output iceandrews XSLT 1 January 14th, 2009 11:14 AM
Remove namespace from output file jopet25 XSLT 12 March 9th, 2007 10:12 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 11:14 AM



All times are GMT -4. The time now is 08:07 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
© 2011 John Wiley & Sons, Inc.