[xsd-users] Incorrect parsing of unqualified attributes in schema with qualified attributes

Vladimir Zykov vladimir.zykov at ncloudtech.ru
Thu Jun 19 10:05:00 EDT 2014


Hi Boris,

We encountered a problem with XSD 4.0.0.a14. For the attached schema it generates wrong code for
parsing attributes from imported schema with attributeFormDefault=“unqualified” while the importing
schema has attributeFormDefault=“qualified”.

For example, the following XML is correct with respect to schema files from the attachments.

<?xml version="1.0" encoding="UTF-8"?>
<s1:root xmlns:s1="http://s.com/S1" xmlns:s2="http://s.com/S2">
    <s1:c>
        <s2:b a="text"/>
    </s1:c>
</s1:root>

However, when we run xsd like this:

./xsd cxx-tree --file-per-type s1.xsd s2.xsd s3.xsd

the generated function parse() for type A assumes that attribute “a” must be qualified and thus the above
XML is not valid since attribute “a” has empty namespace.

There is another inconsistency. When we run xsd without --file-per-type then generated parse() expects
attribute “a” without namespace and this seems to be correct.

Thanks

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xsd.tgz
Type: application/octet-stream
Size: 538 bytes
Desc: xsd.tgz
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20140619/5fde38f0/xsd.obj
-------------- next part --------------
<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><br class="webkit-block-placeholder"></div><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Vladimir Zykov<br>Software Engineer<br>New Cloud Technologies, LLC<br><br></div>

</div>
<br></body></html>


More information about the xsd-users mailing list