f



Generate a XML with an XSD

Hi all,I'm wirting a java program and I want to export same properties to an XML File. For this file I have an XSD scheme.I tried to use a W3C DOM but I have the problem that new elements don't follow the sorting rules in the scheme. How can I connect the scheme to the DOM model that new elements will sort in that order wich is defined in the scheme?Or are there other libraries which can do this?I have had also a look in the eclips xml editor but they prohibit the access to their packages from external projects, so that i can not use their internal model.thx for all hintsMichal-- michael DOT o At gmx DOT net
0
Michael
2/25/2008 10:54:42 PM
comp.lang.java.programmer 52660 articles. 0 followers. Post Follow

2 Replies
303 Views

Similar Articles

[PageSpeed] 31

On 26 =C6=C5=D7, 01:54, Michael Oppenauer <nos...@spam.org> wrote:

XmlBeans library.
http://xmlbeans.apache.org/

BR, Alex
0
Alexander
2/26/2008 9:54:04 PM
On Mon, 25 Feb 2008 22:54:42 +0000 (UTC), Michael Oppenauer
<nospam@spam.org> wrote, quoted or indirectly quoted someone who said
:

>I'm wirting a java program and I want to export same properties to an XML 
>File. For this file I have an XSD scheme.

You can write xml files pretty easily without a schema or even a
library. The schema comes into play when you are trying to read them
and validate the data.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
0
Roedy
2/28/2008 4:01:07 PM
Reply:

Similar Artilces:

Generate an XML in Java using an XML Schema
Hi, Is it possible to create an XML in Java using an XML Schema? Is the XML Schema just for validation? Thanks! V <vmtigno@yahoo.com> wrote in message news:1145378572.065788.33540@u72g2000cwu.googlegroups.com... > Hi, > Is it possible to create an XML in Java using an XML Schema? Is the XML > Schema just for validation? The question isn't entirely clear to me. What you can do is assist the user in creating an XML file, essentially by continuously validating whatever they type against the schema. Another possibility is to analyze the schema, and then generate a mi...

Generate an XML in Java using an XML Schema #2
Hi, Is it possible to create an XML in Java using an XML Schema? Is the XML Schema just for validation? Thanks! V On Tue, 2006-04-18 at 09:43 -0700, vmtigno@yahoo.com wrote: > > Is it possible to create an XML in Java using an XML Schema? Is the > XML > Schema just for validation? Well, XML Schema isn't "just" for validation. It defines the structure that a given document may have, which happens to be useful for validation. I use Castor to generate java objects from XSD. Those objects are essentially beans, which can be marshalled or unmarshalled to or from X...

XML-RPC
Hello, I am getting an error "XML-RPC - java.lang.ClassCastException: java.util.Date" when I call the "XmlRpcClient" execute method. I believe the underlying classes are having trouble parsing the result from the time.xmlrpc.com/RPC2:80 XML-RPC service. I apologize that I could not navigate the Apache bug reporting and search system. I hope someone can recognize what is up with this. Thank you in advance for any help, Michael import java.util.Vector; import java.util.Hashtable; import org.apache.xmlrpc.*; public class GetTime { private final static String serv...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) Thanks in advance, Ganesh Majji ganesh.m@gmail.com wrote: > I am new to DB2. I am getting this error while loading the DB2Driver. I > don't have any idea about where i might have gone wrong. please help > me. Unfortunately my crystal bowl stays dark because you didn't mentioned your operating system and which DB2 version you're using. For Windows, *nix and OS/2 please ensure that your application is using the db2java.zip from SQLLIB\java. Check if there are multiple db2jdbc.dll on your system, remove any extra db2jdbc.dll files on the system. Ensure that you can connect to DB2 with the DB2 workstation tools from your machine. sorry for not mentioning the system details. Operation System is SunOS (Solaris) and DB2 SDK 8.2.2 Thank you very much for the kind response, Ganesh Bernd Hohmann wrote: > ganesh.m@gmail...

Java, validate XML with XSD, XML not containing "xmlns:xsi=..."
I am using java to validate an XML file with a DTD, without having the DVD declaration inside the original file, by setting the doctype dynamically to a transformer like this : transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, dtd); transformer.transform(source, new StreamResult(new StringWriter())); I would like to know if there is a way to validate an XML file with an XSD, again, without having the declaration of the xsd file inside the original XML file, but by declaring it dynamically. Thank you ! killy971 schrieb: > I am using java to validate an XML file with a DTD, without having the > DVD declaration inside the original file, by setting the doctype > dynamically to a transformer like this : > > transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, dtd); > transformer.transform(source, new StreamResult(new > StringWriter())); DTD validation is tightly connected to parsing. So you can parse the result of the transformation with a validating parser. > I would like to know if there is a way to validate an XML file with an > XSD, again, without having the declaration of the xsd file inside the > original XML file, but by declaring it dynamically. Have a look at "Chapter 14. Package javax.xml.validation" of "JSR 206 Java� API for XML Processing (JAXP) 1.3". -- Johannes Koch In te domine speravi; non confundar in aeternum. (Te Deum, 4th cent.) ...

Generate XML file from Java
I have a custom XML format (DTD), and I would like to generate XML files from Java. I investigated Jakarta ECS which has a nice API, but it won't pretty-print -- there are no newlines in the output. Any suggestions? Kai Kai Grossjohann wrote: > I have a custom XML format (DTD), and I would like to generate XML > files from Java. I investigated Jakarta ECS which has a nice API, but > it won't pretty-print -- there are no newlines in the output. > > Any suggestions? > > Kai Transform the XML file without newline with XSLT ( Xalan for example) to a final XML...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

Generate xml from java object
Hi, I need to generate the following xml for a 100 users so I thougth I generate it. <typ:WOUser> <typ:id> <typ:serviceProviderId>AOne</typ:serviceProviderId> <typ:companyId>Acme</typ:companyId> <typ:userId>Alice</typ:userId> </typ:id> <typ:sipAddress>sip:alice@mydomain.com</typ:sipAddress> <typ:firstName>Alice</typ:firstName> <typ:lastName>Wonderland</typ:lastName> <typ:password>{SHA}gpw4BEAbByf3D3PUQV4WJADL5Xs=</ typ:password> </typ:WOUser> </wopi:createUser> The problem I have is to add the prefix typ when I generate it from an WOUser object. Is there a good framework that can do it? All hints and ideas are welcome. mike wrote: > I need to generate the following xml for a 100 users so I thougth I > generate it. > > <typ:WOUser> > <typ:id> > <typ:serviceProviderId>AOne</typ:serviceProviderId> > <typ:companyId>Acme</typ:companyId> > <typ:userId>Alice</typ:userId> > </typ:id> > <typ:sipAddress>sip:alice@mydomain.com</typ:sipAddress> > <typ:firstName>Alice</typ:firstName> > <typ:lastName>Wonderland</typ:la...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

sample on how to generate XML skeleton from XSD
Hello I have generated an XSD file with XMLSPY from XML file which give me all the elem structure I would like to generate the XML skeleton of this associated to this XSD file. Constraint is each elem of XSD generate <_element> <_name> </_name> <_value> </_value> </_element> eg : XSD: ==== <xs:element name="_pointList"> <xs:complexType> <xs:sequence> <xs:element ref="_entries"/> <xs:element ref="_element" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="_element"> <xs:complexType> <xs:sequence> <xs:element ref="_x"/> <xs:element ref="_y"/> </xs:sequence> </xs:complexType> </xs:element> XML requested : =========== <_element> <_name>_pointList</_name> <_value> <_entries>1</_entries> <_element> <_name>_pointList_element</_name> <_value> <_entries>2</_entries> <_element> <_name>_x</_name> <_value> <_entries>0</_entries> </_value> </_element> <_element> <_name>_y</_name> <_value> <_entries>0</_entries> </_value> </_element> </_...

generate java bean from an xml file?
hi.. first don't say xsl, it has some drawbacks (like being too complex) i' was wondering if there is some infrastucture like an object model or something like it that can generate javabean code (i have a custom xml file which i need to use for the source creation). On Thu, 14 Sep 2006 15:46:28 +0100, Elhanan <emaayan@hotmail.com> wrote: > hi.. > > first don't say xsl, it has some drawbacks (like being too complex) i' > was wondering if there is some infrastucture like an object model or > something like it that can generate javabean code (i have a cust...

any tools generate sample XML from XSD?
I want to ask if any tools can generate sample XML from XSD? please advise. thanks!! jrefactors@hotmail.com wrote: > I want to ask if any tools can generate sample XML from XSD? > > please advise. thanks!! > OxygenXML can do this ...

Generate XML on fly in Java dataobject.
I am a newbie so forgive any stupid Q's. Reqt : I have a java data object and I need to have a getter method in it which will return me a XML file for that instance. Eg: I have a class Customer Public class Customer { private long customerid; private String first; private String last; public Customer(){} public long getID() { return customerid; } public String getFirst() { return first; } public String getLast() { return last; } public void setID(long aID) { customerid = aID; } public void setFirst(String afirst) { first = afirst; } public void setLast(String alast) { last = alast; } /** THE NEW METHOD I NEED **/ public String generateXML(long custid) { return XML_FILE ; // NEW REQUIREMENT } } The generate method should return an XML file ( I dont know whether it should be a file reference to a temporary file stored on server or a stream of bytes). This dataobject resides on the WEBLOGIC 7.0 server. Thanks ...

2008 computers.lang for java.programmer
jwehnf iuwhhttp://www.freewebs.com/thuiss/http://indianfriendfinder.com/go/g906725-pmem ashik wrote:Sub: 2008 computers.lang for java.programmerYou have nothing of value to anybody here. Pleasestop wasting our bandwidth.Further, please don't become the latest in a long line of perennial spamming f*ckw*t morons who infestthis usenet newsgroup.-- Andrew Thompsonhttp://www.physci.org/Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200711/1 Andrew Thompson wrote:> ashik wrote:> > Sub: 2008 computers.lang for java.programmer> > You have nothing of...

Steps to generate xml document in java
Can u please explain how a xml document can be generated in java? which API can be used to generate xml document? ...

Steps to generate a XML Document in java
Can you please explain how to generate a xml document in java? Which API must be used to generate XML document in java? ...

Best way to generate XSD from Java
Want to tag Methods first, then input tagged Java file to code generator, like JavaDoc or Velocity, then output XML Schema with elements generated according to parameters provided by tags. Better to use JavaDoc Tags or Annotations? What Templating engine(s) do you recommend? Thanks On 9/28/2012 2:30 PM, the don wrote: > Want to tag Methods first, then input tagged Java file to code generator, > like JavaDoc or Velocity, then output XML Schema with elements generated > according to parameters provided by tags. > > Better to use JavaDoc Tags or Annotations? What Templating engine(s) do you > recommend? Annotations are a lot easier to process than source code parsing. And I assume that you want to write a customer generator. The easy solution is JAXB annotations and schemagen. Arne On Fri, 28 Sep 2012 14:53:43 -0400, Arne Vajh�j wrote: > On 9/28/2012 2:30 PM, the don wrote: >> Want to tag Methods first, then input tagged Java file to code generator, >> like JavaDoc or Velocity, then output XML Schema with elements generated >> according to parameters provided by tags. >> >> Better to use JavaDoc Tags or Annotations? What Templating engine(s) do you >> recommend? > > Annotations are a lot easier to process than source code parsing. > > And I assume that you want to write a customer generator. > > The easy solution is JAXB annotations and schemagen. >...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type of problem and has solved it if he/she could give me a hand or if anyone could just point out what I should be looking for in this type of problem. Thanks in advance... gek ...

XML validation with schema xsd in JAVA
Please can someone give me a link where i can find an example of java code that show how to validate a XML document considering his schema definition. Thank for you help Mavrick wrote: > Please can someone give me a link where i can find an example of java code > that show how to validate a XML document considering his schema definition. You need a parser such as Xerces-Java from http://xml.apache.org/, if you download that it comes with documentation and example code. -- Martin Honnen http://JavaScript.FAQTs.com/ ...

Parsing XSD to generate xml instances
Hello... Is it possible to parse ( or rather read) an xsd file and depending on the constraints in the xsd...develop a java code to generate xml instances confirming to the xsd ? i am working on something called "template based code generation" where in my template is an xsd file which i have to read and create xml instances confirming to the xsd . after that these xml instances would be used as data inputs to another code which will be used to generating test cases. please help! <nethunter55@gmail.com> wrote in message news:1144263616.722498.289450@j33g2000cwa.googlegrou...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114) at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016) at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:778) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413) at javax.swing.RepaintManager.paint(RepaintManager.java:1206) at javax.swing.JComponent._paintImmediately(JComponent.java:5169) at javax.swing.JComponent.paintImmediately(JComponent.java:4980) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:770) at javax.swing.RepaintM...

Java program to generate XML schema documentation?
Does anyone know of a free Java-based utility that will generate JavaDoc like documentation for XML schemas? As you may know, XML Schemas allow you to embed comments via the <xs:annotation> and <xs:documentation> tags. I was hoping that there is a tool that can extract these comments and make them into a readable document. Thanks in advance, Dave ...

Generate xml and to existing xml
Hi, We have the following xml that needs to be generated for 200 users. <wopi:createUser> <typ:WOUser> <typ:id> <typ:serviceProviderId>AOne</typ:serviceProviderId> <typ:companyId>Acme</typ:companyId> <typ:userId>Alice</typ:userId> </typ:id> <typ:sipAddress>sip:alice@mydomain.com</typ:sipAddress> <typ:firstName>Alice</typ:firstName> <typ:lastName>Wonderland</typ:lastName> </typ:WOUser> </wopi:createUser> ServiceProviderId and companyId will be the same but I need to generate a user like: user001 user002 user003 and so on... So I will generate a <wopi:createUser>-Node for each user. Then I have to add this into the existing xml document where we create the serviceProvider and company. I am using java 1.5 and I wonder if you have any advice to me in this matter on how to implement it. cheers, //mike ...

xsd (XML Schema) to c++ code generator
Hi, I am seraching for a tool("freeware") or source code which takes XML schema file(.xsd) and provide c++ code for it.Please send me the links.I have evaluated XSC(XML Schema compiler) http://www.dre.vanderbilt.edu/=AD~boris/xsc/. It do convert xsd to cpp, but it miss some informations.=20 Regards,=20 Pravin. ...

Web resources about - Generate a XML with an XSD - comp.lang.java.programmer

Facebook Testing ‘Select Ad Variations To Generate’ Option In Power Editor?
Facebook appears to be testing a new feature in Power Editor that allows users to more easily test different versions of their ads. continued… ...

Study: Facebook Page Post Ads generate 14% higher ROI for retail sector than Marketplace ads
Page Post Ads in the Facebook News Feed generate 14 percent higher return on investment for companies in the retail sector compared to Marketplace ...

In the Germany iPhone app market, how many downloads/day does one need to generate to become a Top 10 ...
Answer (1 of 3): It highly depends on the country of course. For Germany it takes on a typical day 4k downloads to hit the Top Overall 50 free ...

App Store - iRobohash - Generate unique Robot for you
Get iRobohash - Generate unique Robot for you on the App Store. See screenshots and ratings, and read customer reviews.

All sizes - Google Webmaster Tools - Generate robots.txt - Flickr - Photo Sharing!
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Generate Electricity with Peltier Module - The Seebeck Effect - YouTube
How to generate electricity with a Peltier module and the Seebeck effect along with info about the difference between a thermoelectric cooler ...

Andy Murray's moan over grunting just generates a groan
While Rafael Nadal was repositioning himself among the game's big four last week, Andy Murray was groaning about his opponents grunting to a ...

Inferno expected to generate abnormal, high-altitude cloud
A bizarre weather phenomenon known as a fire cloud is likely to form over the fire raging between Lithgow and Bilpin if weather conditions deteriorate ...

Westfield deal generates $69.5m in banker fees
J.P. Morgan, Rothschild, Citigroup, Credit Suisse, UBS and Morgan Stanley are among a host of investment banks to receive millions in fees.

New taste sensation Akiba generates excitement on opening night
Owners of Canberra's next big eatery, Akiba, are keen to differentiate themselves from the competition.

Resources last updated: 3/13/2016 11:51:44 PM