Adding attribute xml:space

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding attribute xml:space

Karl Stubsjoen
I have an xml document and for one of the elements xml:space should be a valid attribute.  I do not know how to set this up in my schema.  My Xml is not declared with any sort of schema.

Thanks for any help.

Karl..

--
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006
Reply | Threaded
Open this post in threaded view
|

Re: Adding attribute xml:space

Mukul Gandhi
perhaps something like following (this is a simplistic example for this),

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

   <xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>

   <xs:element name="x">
        <xs:complexType>
             <xs:attribute ref="xml:space"/>
        </xs:complexType>
   </xs:element>

</xs:schema>

You may also cache the schema xml.xsd locally, for reliable validation.


On Tue, Jun 7, 2011 at 10:04 AM, Karl Stubsjoen <[hidden email]> wrote:

> I have an xml document and for one of the elements xml:space should be a
> valid attribute.  I do not know how to set this up in my schema.  My Xml is
> not declared with any sort of schema.
> Thanks for any help.
> Karl..
>
> --
> Karl Stubsjoen
> MeetScoresOnline.com
> (602) 845-0006




--
Regards,
Mukul Gandhi

Reply | Threaded
Open this post in threaded view
|

Re: Adding attribute xml:space

Karl Stubsjoen
Perfect!  I was thinking this was more complicated than this.

Thanks again..

Karl..

On Mon, Jun 6, 2011 at 10:38 PM, Mukul Gandhi <[hidden email]> wrote:
perhaps something like following (this is a simplistic example for this),

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

  <xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>

  <xs:element name="x">
       <xs:complexType>
            <xs:attribute ref="xml:space"/>
       </xs:complexType>
  </xs:element>

</xs:schema>

You may also cache the schema xml.xsd locally, for reliable validation.


On Tue, Jun 7, 2011 at 10:04 AM, Karl Stubsjoen <[hidden email]> wrote:
> I have an xml document and for one of the elements xml:space should be a
> valid attribute.  I do not know how to set this up in my schema.  My Xml is
> not declared with any sort of schema.
> Thanks for any help.
> Karl..
>
> --
> Karl Stubsjoen
> MeetScoresOnline.com
> <a href="tel:%28602%29%20845-0006" value="+16028450006">(602) 845-0006




--
Regards,
Mukul Gandhi



--
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006