New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local elements are not parsed correctly when the form is unqualified #26

Closed
dbolene opened this Issue Jan 25, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@dbolene

dbolene commented Jan 25, 2011

I'm not an XML expert (by choice :-) but isn't it legal to not have a default ns attribute like xmlns="someNameSpace" at the root but instead something like:
"xmlns:nsname="someNameSpace" and then prefix the root element with <nsname:RootElement>...</nsname:RootElement>?

scalaxb can't seem to handle this

A full example:

<epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:1" creationDate="2010-03-15T06:07:08Z"
             schemaVersion="1">
   <EPCISBody>
      <EventList>
     <ObjectEvent>
        <eventTime>2010-03-22T11:47:01-05:00</eventTime>
        <eventTimeZoneOffset>-05:00</eventTimeZoneOffset>
        <epcList>
           <epc>urn:epc:id:sgtin:0614141.012345.101</epc>
           <epc>urn:epc:id:sgtin:0614141.012345.102</epc>
        </epcList>
        <action>OBSERVE</action>
        <bizStep>urn:epcglobal:cbv:bizstep:shipping</bizStep>
        <disposition>urn:epcglobal:cbv:disp:in_transit</disposition>
        <readPoint>
           <id>urn:epc:id:sgln:0614141.00000.1234</id>
        </readPoint>
        <bizTransactionList>
           <bizTransaction type="urn:epcglobal:cbv:btt:po">urn:epcglobal:cbv:bt:0614141000005:XYZ123</bizTransaction>
           <bizTransaction type="urn:epcglobal:cbv:btt:desadv">urn:epcglobal:cbv:bt:0614141000005:DA123</bizTransaction>
        </bizTransactionList>
     </ObjectEvent>
      </EventList>
   </EPCISBody>
</epcis:EPCISDocument>
@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jan 25, 2011

Owner

You are absolutely right. The whole issue of unqualified local elements have slipped my mind. The relevant part from the XML Schema spec is XML Representation of Element Declaration Schema Components:

{target namespace}

If form is present and its actual value is qualified, or if form is absent and the actual value of elementFormDefault on the <schema> ancestor is qualified, then the actual value of the targetNamespace [attribute] of the parent <schema> element information item, or absent if there is none, otherwise absent.

Since the default value of elemeFormDefault is unqualified, unless otherwise specified the local elements must be unqualified. Schemas like XML Schema and XHTML specify this value to qualified, but this is a defect of scalaxb not handling form correctly.

Owner

eed3si9n commented Jan 25, 2011

You are absolutely right. The whole issue of unqualified local elements have slipped my mind. The relevant part from the XML Schema spec is XML Representation of Element Declaration Schema Components:

{target namespace}

If form is present and its actual value is qualified, or if form is absent and the actual value of elementFormDefault on the <schema> ancestor is qualified, then the actual value of the targetNamespace [attribute] of the parent <schema> element information item, or absent if there is none, otherwise absent.

Since the default value of elemeFormDefault is unqualified, unless otherwise specified the local elements must be unqualified. Schemas like XML Schema and XHTML specify this value to qualified, but this is a defect of scalaxb not handling form correctly.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jan 27, 2011

Owner

Implemented support for elementFormDefault and form. 303fee6

Owner

eed3si9n commented Jan 27, 2011

Implemented support for elementFormDefault and form. 303fee6

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment