473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XSD - element, element value and attribute ?

Hi,

I'm defining an element that
is based on simpleType named "myPatternType"

<xsd:element name="MyElement">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="myPatternType">
<xsd:attribute name="myAttr" type="myAttrType"
use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

I need to add
<xsd:maxLength value="10"> to MyElement
and I can't find a way to do it.
Thx for any help
MAciek


Jul 20 '05 #1
2 3580
You can either add that restriction in you myPatternType like the following
===========
<xsd:simpleType name="myPatternType">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
<xsd:pattern value="[A-Z]{2}" />
</xsd:restriction>
</xsd:simpleType>
========
or
you have to declare another type which restricts myPatternType to the
maxLength value and the use that type to extend to include the attribute.

Cheers.

"Matthet" <ma*****@polbox.com> wrote in message
news:bk**********@foka1.acn.pl...
Hi,

I'm defining an element that
is based on simpleType named "myPatternType"

<xsd:element name="MyElement">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="myPatternType">
<xsd:attribute name="myAttr" type="myAttrType"
use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

I need to add
<xsd:maxLength value="10"> to MyElement
and I can't find a way to do it.
Thx for any help
MAciek

Jul 20 '05 #2

"strajan" wrote
You can either add that restriction in you myPatternType
or
you have to declare another type which restricts myPatternType to the
maxLength value and the use that type to extend to include the attribute.


Thx,
so you are saying that it is not possible to put my maxLength to my
element?!

myPatternType is used in few elements
myAttrType is also used in few attributes
and
I would like maxLength to be used in only one element
so I think that defining new myPatternType2 is not good idea.

MAciek

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas P. Fuller | last post by:
Hi, Thanks in advance for any help in this matter. I need to embed a link in the text portion of an xml element's value. For example, <some_element> Hi, my name is Tom, and you can find...
2
by: Moonbeam66 | last post by:
I'm looking to convert an element name to an attribute name, where the element name is user-defined. For example <accountNumber>12345678</accountNumber>. I want to convert this to <userTag...
2
by: DesperateDan | last post by:
As the title say, I can't aquire element's value if it hosts sub-elements. Let me explain - My XML looks like this:- <a> <infill>xxxxxx</infill> <SourceEndPoint>testdata <EndPoint> <AliasRef...
2
by: charles-brewster | last post by:
I'm trying to write a simple JavaScript function which will use a button to copy table cell data into a form input text box as the "value" attribute. The following is intended to test the...
2
by: charles-brewster | last post by:
I have progressed the copytext function test page a little since my original post here in the small hours this morning. It now opens a debugging window so I can try to figure out what it is or...
4
by: Matt Kruse | last post by:
According to standards, if an option is selected and it has no VALUE attribute, the contents of the option tag is to be submitted. So: <select name="sel"> <option selected>Value</option>...
2
by: anitawa | last post by:
Hi, Im in a dilemma and need some help. I have an xml like this: <animal species="dog"> <color>brown</color> </animal> <animal species="cat"> <color>black</color>
1
by: Nathan Sokalski | last post by:
I have a page that I created with ASP.NET which contains a RadioButtonList. This obviously shows up as input tags in the generated page. When I was looking at the page with the free Internet...
1
by: otiose3 | last post by:
I've been ploughing through the archives here, but I can't seem to find a solution for my situation... Essentially, I want to run the JQuery script that is in the "value" attribute of my <option>...
0
by: Nathan Sokalski | last post by:
In the RadioButton and CheckBox controls, there is no Value attribute. The html <inputtag has a value attribute, which is used by both type="radio" and type="checkbox". The RadioButtonList and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.