Create XML based on XSD

Hello all,
I need to generate XML file based on XSD template in Java, I can parse the XSD file, but don’t know after parsing, hot to generate XML file.
Do you know any example or suggestion how to do it please? I’m not very expert on this, so I appreciate any help.
Many thanks in advance.

I'm curious why you didn't find this links in google:
http://www.youtube.com/watch?v=kOLziP28598
Using JAXB to generate XML from XSD | Java Code Geeks
bye
TPD

Similar Messages

  • Generating XML based on XSD.

    HI All,
    I have an XSD and some data (in the form of value objects)that needs to be represented as XML . is thr any way to generate my XML dynamically using by data and reading the XSD content.
    Thanks
    -vijay

    Hi,
    If u want to create XML document according to the XSD you defined then u can use the JAXB API, here you do the Marshalling which directly converts the java objects into the XML document.
    Ref this link:-
    http://java.sun.com/xml/jaxb/users-guide/jaxb-using.html#sampapp3

  • Newbie - How to create XML based on given schema

    Hello,
    We have a requirement to create an XML message from our system (Oracle 9iR2 with Oracle Apps 11.5.10). The XML is generated from a query in our HR tables, and must be in a specific format (schema and example XML has been provided to us).
    Newbie question is this: What is the best way to create this XML message (dynamic data coming from a SQL select) while ensuring that it matches the given schema? Most of our developers are strong PL/SQL with limited Java experience.
    Thanks,
    -- John

    I've updated the FAQ with an answer and example for this question...
    Please see the following thread
    How to create XML from relational tables based on an XML Schema ?

  • Unable to create XML based interface while using Interactiveform UIelement

    Dear All,
    I have a node under a subnode which is of a structure type.
    This structure has three components each of which is assigned a table type.
    While generating the XML based interface, message 'unsupported types wont be generated' comes and in the following From layout, I find the data entries for this particular node are invisible.
    Can you suggest a way to achieve the functionality?
    Thank You.
    Regards,
    Prosenjit.

    We should use only data elements and ABAP table structures while working with XML interfaces.

  • Create XML file from XSD

    Hello,
    can anybody help me with generating an empty tagged XML file from a XSD file. Any sample java code will be highly appreciated.
    Thanx in advance.
    A .

    Apache XML Beans presents a way to compile the XSD Schema and generate Java classes for each element defined in the schema. With these interface you can then create new XML instances from the schema. (http://xmlbeans.apache.org/)

  • Namespace issue while generating XML based on xsd

    Hi All,
    I am using Jdeveloper-11.1.1.6
    SOA:- 11.1.1.6
    WLS:- 11.3.6
    When i am publishing xml message i am getting name space issue.
    My process design as i am getting a message from AQ JMS and doing a transformation with out any logic and writing into a file based on the xsd.
    Here is the my target xsd structure
    <xs:schema id="RelieveIntransitSchema"
    targetNamespace="http://tempuri.org/RelieveIntransitSchema.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/RelieveIntransitSchema.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="RelieveIntransits">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="RelieveIntransit" minOccurs="1" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="RelieveStore" minOccurs="1" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence></xs:sequence>
    <xs:attribute name="StoreID" type="xs:string"/>
    <xs:attribute name="Units" type="xs:double"/>
    <xs:attribute name="RelieveAllStores" type="xs:boolean"/>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="HeaderID" type="xs:string" use="optional"/>
    <xs:attribute name="ProductID" type="xs:string" use="required"/>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    My actual target xml should be of
    <?xml version="1.0"?>
    <RelieveIntransits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/RelieveIntransitSchema.xsd">
    <RelieveIntransit HeaderID="DA41198901491301" ProductID="D037-63-1270S">
    <RelieveStore StoreID="D001" Units="0002092 " />
    <RelieveStore StoreID="D003" Units="0000022 " />
    </RelieveIntransit>
    </RelieveIntransits>
    But the out xml generating as below which is not accepted by target system
    <?xml version="1.0" encoding="UTF-8"?>
    <RelieveIntransits xmlns="http://tempuri.org/RelieveIntransitSchema.xsd" xmlns:ns5="http://tempuri.org/RelieveIntransitSchema.xsd"> <ns5:RelieveIntransit ProductID="6534562" HeaderID="10R7771-6534562001-109"> <ns5:RelieveStore Units="5" StoreID="118"/>
    <ns5:RelieveStore Units="5" StoreID="118"/>
    </ns5:RelieveIntransit>
    </RelieveIntransits>
    Could some one please help me how to generate actual one as shown above with out namespace prefix "ns". I tried xsl code for removing name space prefix using https://forums.oracle.com/forums/thread.jspa?threadID=1122673 but it is removing url also.
    Regards,
    Tarak
    Edited by: Tarak on Jul 26, 2012 11:39 AM

    Hi,
    Sorry for my delay response.
    Both xmls are valid and equivalent for me... should be equivalent to <ns1:a xmlns:ns1="namespace"/>...
    I agree to your point.
    What is your target system? If that makes difference for your target system I would say it is not fully XML compliant...
    Target system is an old one called as MID. Yes i agree it is not fully XML Compliant. I am publishing the message through file adapter and it is reading the file.
    But anyway... The trick in the other thread should work... What do you mean by "removing url also" ???
    Using the Namespaces remove xsl code i am getting structure as below. In this alone with prefix name space url also getting removed.
    <RelieveIntransits>
    <RelieveIntransit HeaderID="DA41198901491301" ProductID="D037-63-1270S">
    <RelieveStore StoreID="D001" Units="0002092 " />
    </RelieveIntransit>
    </RelieveIntransits>
    I am expecting like this
    <?xml version="1.0"?>
    <RelieveIntransits xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/RelieveIntransitSchema.xsd">
    <RelieveIntransit HeaderID="DA41198901491301" ProductID="D037-63-1270S">
    <RelieveStore StoreID="D001" Units="0002092 " />
    </RelieveIntransit>
    </RelieveIntransits>

  • Create xml document with xsd

    Hi,
    i'm new at this, so i need some help. I am developing web service that interacts with user over SOAP. User has to send xsd and web service has to create or update xml whitch is something like database. Is this posible?
    Thanx,
    Alan.

    With XMLBeans an XML document may be generated from a schema.
    Refer to section
    Creating New XML Instances from Schema
    http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.html

  • XML issues : Genearte XML based on XSD

    hi please help me in sorting this issue
    How would I generate an XML document from XML-DB which conform to a registered
    Schema? My tables and xsd are as follows:
    Customer table
    ==============
    create table cust
    ( id number primary key,
    last_name varchar2(50),
    first_name varchar2(50),
    fullname varchar2(50),
    dob date
    Cust_address table
    ==================
    create table cust_address
    (addr_id number primary key,
    address_1 varchar2(100),
    address_2 varchar2(100),
    county varchar2(4),
    home_ph varchar2(20),
    office_ph varchar2(20),
    cust_id number references cust(id) );
    Some data
    SQL> insert into cust
    2 values( 1, 'Harvey','John','Jeff M Harvey','18-jun-80');
    1 row created.
    insert into cust_address
    values ( 1,' 21 West Trophy Road','Memphis,
    TN','0009','901-6782345','901-768234',1);
    My XMLSchema is as follows:
    ===========================
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2005 rel. 3 U (
    http://www.altova.com
    by John -->
    <xs:schema
    xmlns="
    http://www.oaws.org/CAR"
    xmlns:xs="
    http://www.w3.org/2001/XMLSchema"
    targetNamespace="
    http://www.oaws.org/CAR"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="CARData">
    <xs:annotation>
    <xs:documentation>Customer Contact information etc
    </xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Name" type="NameType"/>
    <xs:element name="Address" type="AddressType"/>
    <xs:element name="PlayerContact">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Name" type="NameType"/>
    <xs:element name="Address" type="AddressType"/>
    <xs:element name="PlayCntySher" type="xs:string"/>
    <xs:element name="PlayCntyClk" type="xs:string"/>
    <xs:element name="PlayAlsTyp" type="xs:string"/>
    <xs:element name="Play" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="BankContact">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="BKName" type="xs:string"/>
    <xs:element name="BKAddr1" type="xs:string"/>
    <xs:element name="BKAddr2" type="xs:string"/>
    <xs:element name="BKAddrfnl" type="xs:string"/>
    <xs:element name="BKCNTY" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="LTRDT" type="xs:date"/>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="AddressType">
    <xs:sequence>
    <xs:element name="playaddr1">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playaddr2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playaddrfnl" type="xs:string"/>
    <xs:element name="playhomecomm">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playwrkcomm">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playcnty">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NameType">
    <xs:sequence>
    <xs:element name="PlayFullName" type="xs:string"/>
    <xs:element name="PlayFName" type="xs:string"/>
    <xs:element name="PlayLName" type="xs:string"/>
    <xs:element name="PlayDefName" type="xs:string"/>
    <xs:element name="PlayIDNum">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="12"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="PlayDob" type="xs:date"/>
    </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="money">
    <xs:restriction base="xs:decimal">
    <xs:totalDigits value="14"/>
    <xs:fractionDigits value="2"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="CollectorType">
    <xs:sequence>
    <xs:element name="CollectorNumber" type="xs:integer"/>
    <xs:element name="CarFullName" type="xs:string"/>
    <xs:element name="CollectorPhone" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    I have registered this schema in to my database schema
    SQL> begin
    2 dbms_xmlschema.registerSchema
    3 (
    4 '
    http://tien.oaws.silver:8080/home/CAR/xsd/',
    5 xdbURIType('/home/CAR/xsd/CARSchema.xsd').getClob(),
    6 True,True,False,True
    7 );
    8 End;
    9 /
    PL/SQL procedure successfully completed.
    Now I need to generate an XML which include all elements from CUST and
    CUST_ADDRESS table and must conform to the XML Schema, need your help.
    Thank you.

    Please someone help me...

  • How to generate XML file based on XSD in SSIS

    please provide step by step process to create xml based on XSD in SSIS  

    Hi hemasankar,
    In SQL Server Integrated Services, we can generate XML Schema (XSD) file based on a XML file with XML Source Editor. If we want to generate XML file based on a XSD file, we can use Generate Sample XML feature in Visual Studio. For more details, please refer
    to the following steps:
    Click on "XML Schema Explorer" or 'Use the XML Schema Explorer...' to open XML Schema Explorer in Visual Studio. 
    If your Schema file is valid and you are having elements, right-click on element and click on "Generate Sample XML", this functionality generates XML file in temp folder and open ups in the XML Editor.
    The following two document about how to generate XML file based on a XSD file are for your reference:
    http://msdn.microsoft.com/en-us/library/dd489258.aspx
    http://www.codeproject.com/Articles/400016/Generate-Sample-XML-from-XSD
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Create an XML file from XSD file in JDeveloper

    Hi,
    I am working on XML DTD and XSD to validate xml file using JDeveloper.
    1. How we can create xml file from XSD in JDeveloper.
    2. How to design content model very easily..
    3. where can I learn XSD easily.. any URL
    can anyone help out..
    with regards
    Abu Sufian

    The XML node in the new gallery has an option to create XML document from schema
    See this demo:
    http://www.oracle.com/technology/products/jdev/viewlets/1013/xml_viewlet_swf.html
    There are several places on the Web that teaches XSD
    for example: http://www.w3schools.com/schema/

  • FLV xml-based Captioning (Subtitles)

    Hi everyone!
    I am following a tutorial from actionscript.org about
    creating xml-based subtitles in flash through actionscript.
    Although I have followed the instructions and explanations closely,
    I can't seem to make the thing work. Take note, there are no error
    notifications when I test the movie - I have all the classes
    required as well as a sample FLV. Can someone please point out
    what's wrong with this script?
    This is basically the cached link of the tutorial I followed.
    Actionscript.org appears to be inaccessible at the moment.
    FLV
    Xml-based Captioning

    bump thread...

  • Create XML File from a specified XSD file

    Hi,
    I'd like to create an XML document with java. BUT How can we "bind" this creation with a XSD file. Hence, the creation may fail if the XSD binded file is not respected.
    So I know how to create XML file but not bind to this creation my proper XSD file (XML schema). With which tool can I do this ?
    Thanks.

    Hi,
    I'd like to create an XML document with java. BUT How can we "bind" this creation with a XSD file. Hence, the creation may fail if the XSD binded file is not respected.
    So I know how to create XML file but not bind to this creation my proper XSD file (XML schema). With which tool can I do this ?
    Thanks.

  • Creating a XML file from XSD file

    Is there a piece of Java code that will convert a file to XML using a XSD without the use of generated Java classes?
    Thanks alot,
    Amy

    I tried the link in asp.net but When I double click the exe it just pops off and goes.....How to use C# application......I am using Visual web developer 2005......please help in creating XML from XSD file

  • How to create xml nodes based on a value

    Dear friends,
    I've a question about graphical mapping in SAP PI...
    How can I create XML nodes on the target side based on a value in a XML field on the source side.
    For example:
    This XML field on the source:
    <NO_OF_LINES>4</NO_OF_LINES>
    Must result on 4 Lines on the Target:
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    So it's actually the opposite of the Count function...
    I appreciate your help,
    Thank you in Advance,
    Kind regards,
    John

    Hi ,
    Try this
    NO_OF_LINES---> count---> UDF---> LINE
    example :
    UDF Code :
    for (int i=0;i<var1[0];i++)
    result.addValue("");

  • I want to create xml file using photoshop script and also i can easily add, modify, delete based on file name

    Hi,
    Please help me for this.
    I need to create XML file for mentioned below. when i run the photoshop script i need deatails for active document name, date, time and status.
    <?xml version="1.0" encoding="UTF-8"?>
    <sample>
    <filename>Cradboard_Boxes_Small.tif</filename>
    <date>today date</date>
    <starttime>now</starttime>
    <status>delivered</status>
    </sample>
    <sample>
    <filename>Cardboard_Boxes_Student_Vaue_Pack.jpg</filename>
    <date>today date</date>
    <starttime>now</starttime>
    <status>delivered</status>
    </sample>
    I need read that xml after creating and modify based on file name. i need to modify status after file finished.
    if the file name is already exist i want to modify or delete or add whatever i need.
    Kindly help me simple way

    You may want to look into getting Xtools ps-scripts - Browse Files at SourceForge.net then.  Most of the support is for ActionManager script code where XML code is use as an intermediate step.  There are quite a few Photoshop script in XTools .   Ross Huitt is an expert javascript programmer though is is fed up with Adobe's lack of support for Photoshop scripting particularly the bugs in ScriptUI he is still maintaining tool he  has created for us free of charge. Tools like Image Processor Pro. None of his scripts are save as binary so you can read all of his code there is a wealth of knowledge in there....
    Also there is a scripting forum Photoshop Scripting

Maybe you are looking for

  • Firewire 800 is choppy on proxy media, USB 2.0 not...

    Hello dear apple community, i am new to FCPX and have a strange problem playing proxys in the timeline and video viewer. I import my AVCHD 1080/50p clips from SD Card directly to my external WD My Book Studio FW800 2TB drive. Options: create Proxy, p

  • Odd open with behavior

    Hi, Normally, when right-clicking a file, for example, a pdf, in ID, and selecting a particular program to open that file with (say, AI) would start the chosen program.  Lately, things haven't been working as expected, at least in one document.  Open

  • Tomcat 5.0 & JavaBean

    I'm getting in trouble with Tomcat & JavaBean. 1) I've installed Tomcat 5.0 in the following directories: "C:\Programmi\Apache Software Foundation\Tomcat 5.0" 2) I've started Tomcat and I tried it in "http://localhost:8080". Tomcat Web Server works p

  • DOB  ISSUE

    Hi, I have 2 prompts 1.from Date 2.To Date in dash board.if i select those prompts the result will display as date of birth of the users who are existing b/w those dates. Ex:01/04/2015 to 02/04/2015 result: User   DOB    A      01/04/1976    B      0

  • URGENT: Consultant/Freelancer Needed

    Hi All, Sorry for the urgency, but we are seeking a Director expert to help us in a critical stage of a project. We need someone to help as early as the evening of June 8, 2007 through the weekend. Overview: We have authored an application in Directo