473,394 Members | 1,724 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,394 software developers and data experts.

JDOM and XSD

44
Hi everybody! I´m doing this java program using JDOM and i get the error "The value of the element is invalid - The value '' is invalid according to its datatype 'Integer' " (I´m using Visual Studio 2005 as a XML program validator). How can a xsd element be either empty (like the empty string "") or an integer ???

Would be most thankfull for any help!

Best regards
Aug 12 '07 #1
2 3205
details for how to use the union type go to: http://technograffiti.wordpress.com/...-types-in-xml/
Apr 1 '10 #2
jkmyoung
2,057 Expert 2GB
Combine the types.
Expand|Select|Wrap|Line Numbers
  1. <xs:element name="a" type="integerOrEmpty"/>
  2.  
  3. <xs:simpleType name="integerOrEmpty">
  4.   <xs:union>
  5.    <xs:simpleType>
  6.      <xs:restriction base="xs:integer"/>
  7.    </xs:simpleType>
  8.    <xs:simpleType>
  9.      <xs:restriction base="xs:token">
  10.       <xs:enumeration value=""/>
  11.     </xs:restriction>
  12.    </xs:simpleType>
  13.  </xs:union>
  14. </xs:simpleType>
--edit. Didn't realize this thread was necro'ed. Really belongs in the XML forum.
Apr 1 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: mali_djuro | last post by:
Hi all, i used JDOM to create XML file. first, i get data from database and create Document object. in some data i have quotas, so it makes replacment in content of elements. for example: if i...
0
by: Son of beach | last post by:
I am the beginner of XML. Somebody suggests me to use JDOM for read/ write XML file. I success to use JDOM for reading XML, but get difficulty to update a XML file. Do you have any simple...
2
by: Praveen Chhangani | last post by:
Folks, I was wondering if it were possible to convert an org.jdom.doc to an org.w3c.doc document. Essentially what I have is an already parsed document using jdom and I would like to use the...
3
by: Michael | last post by:
hello, I'm a java programmer, and my program will require to parse XML documents and extract data from it, then built a new XML document. Should JDOM or Xerces be the best for me? Please help....
1
by: Bernd Oninger | last post by:
When I compile my java source with jdom b10 the compiler tells me that the instrcution XMLOutputter outputter = new XMLOutputter(" ", true); Outputter.output(doc, new FileWriter("t.xml")); is...
3
by: Bernd Oninger | last post by:
When I run the successfully compiled java source shown at the end I got a runtime error: Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content Where is the missing class ?...
0
by: kyancy | last post by:
Hello All. We have several XML schemas to describe common component document parts. We then create new XML schemas as necessary that use "xsd:import schemaLocation=whateverLocation.." to include...
2
by: zhengwt | last post by:
I used JDOM.jar to process xml-based document. Recently, I meet such a problem that I can not solve. First, I use the following code generate xml text: Element root = new Element("Root");...
4
by: Vijay Anandh | last post by:
Hi All, I am new to JDOM and I am currently coding a program to build xml files using JDOM. The size of the xml file which i am goin to build will be in the order of a few GB's( 1 to 5 GB)....
0
by: idorjee | last post by:
Hi Can anyone please help me why my java program says the following when I try to build it in NetBeans: Compiling 1 source file to /Users/Desktop/Jproject/jdom/build/classes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.