i'm trying to work out why enabling schema processing disables namespace
prefixes in the parsed output. take the following example:

DOMPrint -n collection.xml

<collection xmlns:y="uri:yahoo" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:yes="uri:yes" xs:noNamespaceSchemaLocation="collection.xsd">

    <instances>
        <!--
        <instance guid="MSD001"/>
        <instance guid="MSD002"/>
        -->
    </instances>
    <bootstrapGuid>bsp</bootstrapGuid>
    <y:timeKeeper>
        <created>1999-05-31T13:20:00.000-05:00</created>
        <accessed xs:nil="true"/>
        <modified xs:nil="true"/>
    </y:timeKeeper>
</collection>

DOMPrint -n -s collection.xml

<collection xmlns:y="uri:yahoo" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:yes="uri:yes" xs:noNamespaceSchemaLocation="collection.xsd">

    <instances>
        <!--
        <instance guid="MSD001"/>
        <instance guid="MSD002"/>
        -->
    </instances>
    <bootstrapGuid>bsp</bootstrapGuid>
    <timeKeeper>
        <created>1999-05-31T13:20:00.000-05:00</created>
        <accessed xs:nil="true"/>
        <modified xs:nil="true"/>
    </timeKeeper>
</collection>

notice the y: has disapeared from <timeKeeper> - why is this? 

this makes it impossible to serialise the instance document back to disk and
parse it again.

i have attached the schemas.

chris.

-- 

christopher kelly <[EMAIL PROTECTED]>
yahoo! enterprise solutions, 10 ebury bridge road, london, sw1w 8pz
pgp public key: http://kuffworks.com/cck.pgp
tel: +44 (0)207 808 4525
gsm: +44 (0)7796 688 050
sms: [EMAIL PROTECTED]
<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:y="uri:yahoo"
           xmlns:yes="uri:yes">

    <xs:import namespace="uri:yahoo" schemaLocation="y.xsd"/>
    <xs:import namespace="uri:yes" schemaLocation="yes.xsd"/>

    <xs:annotation>
        <xs:documentation xml:lang="en">
            $Id: collection.xsd,v 1.5 2002/04/01 21:25:03 cck197 Exp $
            $Source: /CVSROOT/yahoo/properties/yes/portalid_admin/collection.xsd,v $
            Collection schema for YES.
            
http://groups.yahoo.com/group/yes-proddev/files/Eureka/Specs/spec_portalID_upgrade.html
        </xs:documentation>
    </xs:annotation>

    <xs:element name="collection">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="instances" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="instance" minOccurs="0" 
maxOccurs="unbounded">
                                <xs:complexType mixed="true">
                                    <xs:attribute name="guid" type="yes:guid"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="bootstrapGuid" type="y:guid" minOccurs="1" 
maxOccurs="1"/>
                <!-- a list of identifiers for existing object instances -->
                <xs:element name="instanceGuid" type="yes:guid" minOccurs="0" 
maxOccurs="unbounded"/>
                <!-- book keeping timestamp -->
                <xs:element ref="y:timeKeeper" minOccurs="1" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
        <xs:unique name="uniqueInstance">
            <xs:selector xpath="instances/instance"/>
            <xs:field xpath="@guid"/>
        </xs:unique>
    </xs:element>
</xs:schema>

<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:yes="uri:yes"
           targetNamespace="uri:yes">

    <xs:annotation>
        <xs:documentation xml:lang="en">
            $Id: yes.xsd,v 1.3 2002/03/05 18:19:01 cck197 Exp $
            $Source: /CVSROOT/yahoo/properties/yes/portalid_admin/yes.xsd,v $
            Standard Yahoo! Enterprise Services schema declarations
        </xs:documentation>
    </xs:annotation>

    <xs:simpleType name="guid">
        <xs:annotation>
            <xs:documentation>
                A globally unique identifier with respect to YES
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z]{3,5}[0-9]{3}"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:element name="portalIdBookKeeper">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="maxPortalIds" type="xs:positiveInteger" 
minOccurs="1" maxOccurs="1"/>
                <xs:element name="expires" type="xs:dateTime" nillable="true" 
minOccurs="1" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:y="uri:yahoo"
           targetNamespace="uri:yahoo">

    <xs:include schemaLocation="contact.xsd"/>
    <xs:include schemaLocation="i18n.xsd"/>

    <xs:annotation>
        <xs:documentation xml:lang="en">
            $Id: y.xsd,v 1.5 2002/04/01 15:03:56 cck197 Exp $
            $Source: /CVSROOT/yahoo/properties/yes/portalid_admin/y.xsd,v $
            Standard Yahoo! schema declarations
        </xs:documentation>
    </xs:annotation>

    <xs:element name="timeKeeper">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="created" type="xs:dateTime" minOccurs="1" 
maxOccurs="1"/>
                <xs:element name="accessed" type="xs:dateTime" nillable="true" 
minOccurs="1" maxOccurs="1"/>
                <xs:element name="modified" type="xs:dateTime" nillable="true" 
minOccurs="1" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- xerces-c doesn't seem to support [:class:] POSIX character classes -->

    <xs:simpleType name="password">
        <xs:annotation>
            <xs:documentation>
                A shared secret
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value=".{12}">
                <xs:annotation>
                    <xs:documentation>
                        A string of any character exactly 12 long
                    </xs:documentation>
                </xs:annotation>
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    

    <xs:simpleType name="spaceId">
        <xs:annotation>
            <xs:documentation>
                Used for Yahoo! internal reporting
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:positiveInteger">
            <xs:pattern value="[0-9]{1,12}">
                <xs:annotation>
                    <xs:documentation>
                        A string of 12 digits
                    </xs:documentation>
                </xs:annotation>
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="udbNamespace">
        <xs:annotation>
            <xs:documentation>
                a suffix for appending to a udb key
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-9_]{1,32}">
            <xs:documentation>
                A string of underscore, alphabetic or numeric characters between 1 and 
32 long
            </xs:documentation>
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="userId">
        <xs:annotation>
            <xs:documentation>
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-9_]{1,32}">
            <xs:documentation>
                A string of underscore, alphabetic or numeric characters between 1 and 
32 long
            </xs:documentation>
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="guid">
        <xs:annotation>
            <xs:documentation>
                A globally unique identifier with respect to Yahoo!
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-9_]{1,32}">
            <xs:documentation>
                A string of underscore, alphabetic or 
                numeric characters between 1 and 32 long
            </xs:documentation>
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to