Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema Question

Reply
Thread Tools

XML Schema Question

 
 
Colin Goudie
Guest
Posts: n/a
 
      02-16-2004
How would you generate a schema for an complex type that needs atrributes
and match a pattern
i.e.
XML
<BaseIpAddress name="Base I.P. Address">203.0.171.191</BaseIpAddress>

the ip number in the tags needs to be correctly formatted
with minLength=7, maxLength=15, and pattern "

Currently I have this

<xs:element name="BaseIpAddress">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"
fixed="Base I.P. Address" />
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="7" />
<xs:maxLength value="15" />
<xsattern
value="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="units" type="xs:string" use="optional"
fixed="I.P. Ver4 Address" />
</xs:complexType>
</xs:element>

But that equates to
<BaseIpAddress name="Base I.P.Address" value="0.0.0.0" units="I.P. Ver4
Address"/>

I'd like this not to be an empty tag


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57