Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: simple attribute question

From: "Priscilla Walmsley" <priscilla@--------.--->
To: "'Rob Harrington'" <robot252@-----.--->, <xmlschema-dev@--.--->
Date: 8/11/2004 12:18:00 PM
Hi,

Try:

<xsd:complexType name="itemType">
  <xsd:simpleContent>
  	<xsd:extension base="xsd:positiveInteger">
	  <xsd:attribute name="sometext" type="xsd:string"/>
  	</xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>

<xsd:element name="item" type="itemType"/>

Hope that helps,
Priscilla
-----------------------------------------------------
Priscilla Walmsley             priscilla@w...
Author, Definitive XML Schema     (Prentice Hall PTR)
-----------------------------------------------------  

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Rob Harrington
> Sent: Wednesday, August 11, 2004 2:25 PM
> To: xmlschema-dev@w...
> Subject: simple attribute question
> 
> 
> Newbie here.  Apologies in advance if this isn't the
> correct forum - if so please advise where I can take
> this question.
> 
> In my schema definition, I simply want to express this
> xml:
> 
> <item sometext="attributeText">9899</item>
> 
> where 9899 is a positive integer.
> 
> in the schema, it seems I can't declare this
> structure, the best I can get to is something like
> this:
> 
> <item sometext="attributeText">
>   <someIdTagIDontWant>9899</someIdTagIDontWant>
> </item>
> 
> Here's what would get me that:
> 
> <complexType name=itemType>
>   <sequence>
>     <element name=someIdTagIDontWant
> type=type="xs:long"/>
>   </sequence>
>   <attribute name="sometext" type="xsd:string"/>
> </complexType>
> 
> <element name="item" type="itemType"/>
> 
> Is this correct, or have I not dug deep enough?  I
> really don't want the someIdTagIDontWant.
> 
> Thanks.
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> 
> 
> 


From jeni@j... Wed Aug 11 20:29:35 2004
Received: from dr-nick.w3.org ([18.29.1.73])
	by frink.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent