Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - XML Validation in IntelliJ

 
Thread Tools Search this Thread
Old 05-19-2006, 12:19 AM   #1
Default 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



dorothys
  Reply With Quote
Old 05-19-2006, 01:35 AM   #2
Joe Kesselman
 
Posts: n/a
Default Re: XML Validation in IntelliJ

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
  Reply With Quote
Old 05-19-2006, 02:21 AM   #3
dorothys
 
Posts: n/a
Default Re: XML Validation in IntelliJ

Thanks you so much!!
-Dorothy

  Reply With Quote
Old 05-19-2006, 03:16 AM   #4
dorothys
 
Posts: n/a
Default Re: XML Validation in IntelliJ

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

  Reply With Quote
Old 05-19-2006, 03:43 AM   #5
dorothys
 
Posts: n/a
Default Re: XML Validation in IntelliJ

Thanks..It has been fixed as below:

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

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump