Subject:Inconsistent usage of quotes in xsd editor Author:Jesus Peraita Date:02 Oct 2007 11:21 AM
Dear all,
The schema editor has a peculiar way of handling quotes.
Given this (Stylus Studio-generated) fragment:
...
<xsd:element name='record'>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref='id'/>
<xsd:element ref='changed'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
If I change the cardinality of 'id' to minOccurs='0', I get the following:
...
<xsd:element name='record'>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="id" minOccurs="0"/>
<xsd:element ref='changed'/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
So, Studio uses single quotes when generating the initial xsd file but changes to double quotes when this xsd is somehow modified.
Am I missing something?
Is there a way to stick to just one kind of quotes?
Subject:Inconsistent usage of quotes in xsd editor Author:Minollo I. Date:02 Oct 2007 01:07 PM
Usually XML documents and XML Schemas are meant for consumption by software applications rather than by human beings; software applications don't distinguish between single and double quotes usage, as the grammar allows both. As usually readability of the documents is not affected by the use of quotes, development/debugging by humans is usually not negatively impacted either.
Indentation is slightly different; it does indeed change the underlying representation of the XML document (in fact, in some cases software applications do complain on indented files, having to deal with text nodes that might be unexpected), but it helps enourmously during development and debugging by humans.
Anyway, thanks for the feedback, we'll surely keep it under consideration.
Subject:Inconsistent usage of quotes in xsd editor Author:Jesus Peraita Date:02 Oct 2007 01:26 PM Originally Posted: 02 Oct 2007 01:27 PM
Thanks for your reply.
You're right. Once the schema goes into production, it will consumed only by machines. But first it must go through several cycles of peer-reviewing, analysing, refining, etc.
Here, humans (developers) will literally turn the whole thing inside out, and use tools like Stylus Studio and xmlSpy to look at the xsd code. That's the stage at which an unconsistent usage of quotes worries me. Not because it will impact the actual usage of the xsd, but because my colleagues might not get a good image of my coding style.