473,473 Members | 4,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML Validation in IntelliJ

Did anyone try to edit XML And XSD in intelliJ?

I wonder whether it support some XML validations, such as:

1) nillable=false
Although I defined an element should not be null, but it still allows
empty value.

2) xs:key
i tried to use "xs:key" to make the values of an element to be unique,
but seems no any effects..

Any advices will be highly appreciated!!

Any good XML Validator could be recommended?

-Dorothy

May 18 '06 #1
4 1913
dorothys wrote:
1) nillable=false
Although I defined an element should not be null, but it still allows
empty value.
Empty and nil are different things. Empty is a value, though a short
one. Nil is a separate flag meaning "no meaningful value", and is
indicated by the presence of the xsi:nil attribute. See:

http://www.w3.org/TR/2004/REC-xmlsch...20041028/#Nils

If you want to forbid the empty value, use facets to constrain the value
(if it's a string, set a minimum length).
2) xs:key
i tried to use "xs:key" to make the values of an element to be unique,
but seems no any effects..


If all you want is uniqueness, declare the value as unique. Key has
additional semantics when combined with keyref. See:

http://www.w3.org/TR/2004/REC-xmlsch...yingUniqueness
http://www.w3.org/TR/2004/REC-xmlsch...ysAndtheirRefs
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 19 '06 #2
Thanks you so much!!
-Dorothy

May 19 '06 #3
Still have problem..:(

What i am trying to do is to check the uniqueness of "product" as
below:

<supported-products>
<product>m5</product>
<product>m10</product>
<product>m20</product>
<product>m40</product>
<product>m160</product>
<product>t640</product>
<product>t320</product>
</supported-products>

And I defined in XSD as below:

<xs:unique name="products-name-unique">
<xs:selector xpath=".//supported-products"/>
<xs:field xpath="./product/text()"/>
</xs:unique>

But it tells that

Error:Error:line (62)c-general-xpath: The expression
'./product/text()' is not valid with respect to the XPath subset
supported by XML Schema.

Any suggestions???

Thanks !!

-Dorothy

May 19 '06 #4
Thanks..It has been fixed as below:

<xs:unique name="products-name-unique">
<xs:selector
xpath=".//supported-products/product"/>
<xs:field xpath="."/>
</xs:unique>

May 19 '06 #5

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

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
1
by: Lipei | last post by:
I have once try IntelliJ IDEA.And I can refactor easily,I can add try and catch just by a few clicks.It also can help me analazy the program's error.(e.g It warned me that I did't initialize the...
4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
6
by: Stephen | last post by:
Hi, the validation controls dont work on Netscape or Mozilla and only on Internet Explorer why? How do i correct this problem? Thanks
7
by: Ryan Ternier | last post by:
We're running a site that has required field validation on the login page. It works fine on our development / test machines. However, when I upload this site to our live server i get this error. ...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
4
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.