dvdlei Posted January 25, 2007 Share Posted January 25, 2007 Does anyone know if it is allowed to use space characters right before and after the 'equals'-sign?<?xml version = '1.0' encoding = 'UTF-8' ?>The offical page http://www.w3.org/TR/REC-xml/ says:Eq ::= S? '=' S?Does the question mark here mean that it is allowed to use spaces here? Link to comment Share on other sites More sharing options...
kvnmck18 Posted January 25, 2007 Share Posted January 25, 2007 This:<?xml version="1.0" encoding="UTF-8"?>or this:<?xml version='1.0' encoding='UTF-8'?>...you need them like that.Why do you not? Link to comment Share on other sites More sharing options...
dvdlei Posted January 26, 2007 Author Share Posted January 26, 2007 This:<?xml version="1.0" encoding="UTF-8"?>or this:<?xml version='1.0' encoding='UTF-8'?>...you need them like that.Why do you not?We receive this XML from an external party, and I wonder if it's fair to tell them they are not following the exact XML specs. What do you think? Link to comment Share on other sites More sharing options...
boen_robot Posted January 26, 2007 Share Posted January 26, 2007 The syntax of the spec is known as BNF. Read more about it in ALA's article How to Read W3C Specs?.According to it, and the XML spec itself, it seems using spaces between the equal sign is allowed. It's not exactly a best practice but it's allowed. So technically speaking, they are not violating the spec. It's fair to tell them that they are not using best writing practices, but invalid/not well formed - certanly not. Link to comment Share on other sites More sharing options...
dvdlei Posted January 28, 2007 Author Share Posted January 28, 2007 The syntax of the spec is known as BNF. Read more about it in ALA's article How to Read W3C Specs?.According to it, and the XML spec itself, it seems using spaces between the equal sign is allowed. It's not exactly a best practice but it's allowed. So technically speaking, they are not violating the spec. It's fair to tell them that they are not using best writing practices, but invalid/not well formed - certanly not.Thank you for your clear answer boen_robot, The BNF standard was new for me and helped me alot with interpreting the syntax of these specs. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now