Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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
 
Old September 28th, 2007, 08:14 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default standalone declaration

I get an error on
  • <?xml version="1.0" standalone="no" encoding="UTF-8"?>
while
  • <?xml version="1.0" encoding="UTF-8" standalone="no"?>
is accepted. What is the specific rule regarding ordering. Thank you.

 
Old September 28th, 2007, 08:30 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

From http://www.w3.org/TR/REC-xml/#sec-prolog-dtd

XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

Therefore, the correct order is version, encoding, standalone declaration.

Not, that while these may look like XML attributes neither these, or those found in processing instructions are actually attributes, they mealy follow the label/value pair convention of attributes.

/- Sam Judson : Wrox Technical Editor -/
 
Old September 28th, 2007, 08:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You could have done what I just did in 10 seconds: go to the XML recommendation, search for "XML declaration", follow the link, and reach

http://www.w3.org/TR/REC-xml/#NT-XMLDecl

which tells you:

[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

that is, the encoding declaration must come before the standalone declaration.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 28th, 2007, 08:42 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

ooh, beat ya :)

/- Sam Judson : Wrox Technical Editor -/
 
Old September 28th, 2007, 08:56 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mhkay
 You could have done what I just did in 10 seconds: ...
 And rob you of an opportunity to be condescending? Never!

 
Old September 28th, 2007, 08:57 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by samjudson
 From http://www.w3.org/TR/REC-xml/#sec-prolog-dtd

XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

Therefore, the correct order is version, encoding, standalone declaration.

Not, that while these may look like XML attributes neither these, or those found in processing instructions are actually attributes, they mealy follow the label/value pair convention of attributes.

/- Sam Judson : Wrox Technical Editor -/
Thank you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone use of MS Script Editor? jhchristenson VBScript 1 September 23rd, 2008 06:43 AM
changing system from standalone to distributed Niranjandubey Book: Wrox's Visual C# 2005 Express Edition Starter Kit 0 July 23rd, 2008 01:23 AM
Windows Standalone app echovue Visual Basic 2005 Basics 3 March 12th, 2007 03:27 PM
Standalone Forum kulrom BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 November 12th, 2006 02:06 AM
WriteXml standalone property mega ADO.NET 0 June 21st, 2006 09:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.