Dynamic  Introspection of XSD

Is there a package/class or open source supporting dynamic introspection of an XML schema? I know there are mechanisms for statically binding Java to XML, but I want/need to dynamically introspect/traverse the schema.

private static Document loadXSD(String xsdFileID) throws SAXException, IOException {
     String documentName = "com/...youpackage..../"+xsdFileName+".xsd";
     Class c=null;
     try{
          c = Class.forName("load your class");
     }catch(Exception e){
          System.out.println(e.getMessage());
     InputStream instream = c.getClassLoader().getResourceAsStream(documentName);
         InputSource inputsrc = new InputSource(instream);
         DOMParser xParser = new DOMParser();
         xParser.parse(inputsrc);
         Document xDoc = xParser.getDocument();
     return xDoc;
}

Similar Messages

  • Dynamic imports of xsd

    Is it possible in BPEL to dynamically import an xsd? If i have a string containing the location (locally) of that xsd or a url passed in as a variable, can I then import this schema and define a variable of that schema type?
    Thanks for your help.

    private static Document loadXSD(String xsdFileID) throws SAXException, IOException {
         String documentName = "com/...youpackage..../"+xsdFileName+".xsd";
         Class c=null;
         try{
              c = Class.forName("load your class");
         }catch(Exception e){
              System.out.println(e.getMessage());
         InputStream instream = c.getClassLoader().getResourceAsStream(documentName);
             InputSource inputsrc = new InputSource(instream);
             DOMParser xParser = new DOMParser();
             xParser.parse(inputsrc);
             Document xDoc = xParser.getDocument();
         return xDoc;
    }

  • Dynamic declaration of XSD datatype in Java

    Hi,
    I am writing a dynamic client for invoking web service solely based on the information from their wsdl documents. Suppose the service uses some customized datatype defined with XSD. Assume I have those datatypes in Java class already. Now I can parse the wsdl document to get the name of a specific datatype of an input part. But how can I declare an object of that datatype in Java with the name of that datatypestored in a variable? One possible solution is to compare it against all possible datatype names, like
    if (name.equals("string") {
    String myObject = new String();
    }else if (name.equals("integer") {
    Integer myInteger = new Integer();
    But obviously this isn't a practical solution since thedatatypes are so many, not even mention user defined ones.
    Can anyone giveme some suggestion? Thanks a lot.
    Yu

    Class.forName(String name)
    The Java Tutorial� - Trail: The Reflection API

  • Service Registry XSD dynamic reference not working

    Hi ,
    I have published an employee canonical schema to service registry. I have referenced it in my BPEL in my wsdl file as follows
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://systinet.com/uddi/demo/employeeList" schemaLocation="employees.xsd" id="uddi:company:HR:EmployeeCanonical" />
              </schema>
    I have deployed the BPEL and is working fine. When I updated the service registry to point to the lastest version of canonical file , the BPEL is not reflecting to the new version. I have bounced both bpel server and reg. service but still no difference.
    please let me know how I can dynamically reference the xsd in service registry.
    appreciate your help.
    thanks
    Srini

    Hi
    I am having trouble making the BPEL and Systinet to work together. I have Systinet and BPEL installed separately on 2 different servers. I deployed my web services and registered them in UDDI. I created a new BPEL process and added a partner link to refer to one of the web service I have registered in UDDI. When I create the partner link, it is forcing me to give the wsdl and it also gives an error message " There are no partner link types defined in current wsdl. Do you want create that will by default create partner link type for you?". If I say "NO' then deployment fails. If I say "Yes", then it creates a new wsdl file on the local server etc and gives "<Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 75164a0815ea471a:-3be8c246:117cc377894:-537b. Please check the process instance for detail.</faultstring>". Any help is appreciated.

  • Dynamic Java bean classes for XSD using JAVA (not any external batch or sh)

    Hi,
    How can we generate dynamic Java bean classes for XSD (dynamically support All XSD at runtime)?
    Note: - Through java code via only needs to generate this process. (Not using any xjc.bat or xjc.sh from JAXB).
    Thanks

    Muthu wrote:
    How can we generate dynamic Java bean classes for XSD (dynamically support All XSD at runtime)?
    Pretty sure you can't. Probably can do a lot of them with years of work.
    And can probably can do a resonable subset suitable for the business at hand with only a moderate effort.
    Note: - Through java code via only needs to generate this process. (Not using any xjc.bat or xjc.sh from JAXB).The Sun jdk, not jre, comes with the java compiler as part of it. You can create in memory class (I believe in memory) based on java code you create.
    I believe BCEL alllows the same thing (in memory) but you start with byte codes.
    You could just create a dynamic meta data solution as well, via maps and generic methods. Not as fast though.

  • Select XML Schema resource dynamically in Oracle Service Bus 10gR3

    I have configured a Any XML Service Proxy service in OSB 10gR3. Based on one of the elements in the XML, name of the XML Schema against which the XML would be validated is got.
    For the Validate action in the message flow modelling, how do I select the XML Schema resource dynamically based on the element in the request?
    Please help.

    XML 1 :
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <Request1>
              <servicename>FECService</servicename>
              <description>service</description>
              <code>456578</code>
         </Request1>
    </soapenv:Body>
    XML 2 :
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <Request2>
    <servicename>EIDService</servicename>
              <source>FEC</source>
              <destination>service</destination>
         </Request2>
    </soapenv:Body>
    Now, based on service name in each request, I am fetching the respective XSD path into a variable from the DB.
    But then how do I add the validate action that dynamically selects an XSD resource....because I could not find a facility to give an expression in Validate Action

  • Native Format Builder in File Adapter - NXSD:ConditionValue

    Hello,
    I am trying to build a schema using the Native Format Builder in the File Adapter. I am using the option "Multiple Records of different types"
    The CSV file will look like the one shown below, the first column will have either DS, Shipping or an alpha numeric value (not a static value). How should the condition value look like for a dynamic value?
    <xsd:element name="RECORD1" nxsd:conditionValue="OrderDetailSKU"> - Static value, the value SKU will not change
    *<xsd:element name="RECORD2" nxsd:conditionValue="1"> - This value differs per order, it can be any number or alphabet or a combination of a number and an alphabet*
    <xsd:element name="RECORD3" nxsd:conditionValue="DS"> - Static value, the value SKU will not change
    <xsd:element name="RECORD4" nxsd:conditionValue="Shipping"> - Static value, the value SKU will not change
    SKU,VendorID,PurchaseOrderNumber,RefNum,OrderStatus,Invoice#,InvoiceAmt,FreightCharge,ProcessingFee,Qty,QtyOrdered,QtyShipped,Price,Net,TotalNoBoxes,BoxNo,BoxWeight,BoxWidth,BoxHeight,BoxLength,ShipMethod,TrackingNumber,StatusDate
    1,266219,648290074,648290074,Shipped,648290074,17,0,0,1,1,1,15,17,1,1,5,,,,UPSG,,
    DS,,648290074,648290074,Shipped,648290074,17,0,0,1,1,1,2,17,1,1,5,,,,UPSG,,
    Shipping,,648290074,648290074,Shipped,648290074,17,0,0,1,1,1,0,17,1,1,5,,,,UPSG,1Z4R3E350366250200,
    1,,648290075,648290075,Shipped,648290075,77,0,0,5,5,5,15,77,1,1,11,,,,UPSG,,
    DS,,648290075,648290075,Shipped,648290075,77,0,0,1,1,1,2,77,1,1,11,,,,UPSG,,
    Shipping,,648290075,648290075,Shipped,648290075,77,0,0,1,1,1,0,77,1,1,11,,,,UPSG,1Z4R3E350366250201,
    1,,648290076,648290076,Shipped,648290076,32,0,0,1,1,1,15,32,1,1,7,,,,UPSG,,
    2,,648290076,648290076,Shipped,648290076,32,0,0,1,1,1,15,32,1,1,7,,,,UPSG,,
    DS,,648290076,648290076,Shipped,648290076,32,0,0,1,1,1,2,32,1,1,7,,,,UPSG,,
    Shipping,,648290076,648290076,Shipped,648290076,32,0,0,1,1,1,0,32,1,1,7,,,,UPSG,1Z4R3E350366250202,
    1,,648290077,648290077,Shipped,648290077,107,0,0,2,2,2,15,107,1,1,11,,,,UPSG,,
    5,,648290077,648290077,Shipped,648290077,107,0,0,5,5,5,15,107,1,1,11,,,,UPSG,,
    DS,,648290077,648290077,Shipped,648290077,107,0,0,1,1,1,2,107,1,1,11,,,,UPSG,,
    Shipping,,648290077,648290077,Shipped,648290077,107,0,0,1,1,1,0,107,1,1,11,,,,UPSG,1Z4R3E350366250203,
    1,,648290079,648290079,Shipped,648290079,122,0,0,2,2,2,15,122,1,1,11,,,,UPSG,,
    2,,648290079,648290079,Shipped,648290079,122,0,0,3,3,3,15,122,1,1,11,,,,UPSG,,
    5,,648290079,648290079,Shipped,648290079,122,0,0,3,3,3,15,122,1,1,11,,,,UPSG,,
    DS,,648290079,648290079,Shipped,648290079,122,0,0,1,1,1,2,122,1,1,11,,,,UPSG,,
    Shipping,,648290079,648290079,Shipped,648290079,122,0,0,1,1,1,0,122,1,1,11,,,,UPSG,1Z4R3E350366250204,
    I need the above CSV to be translated to the below format for each order,
    <ns1:order>
         <ns2:order_number>648290076</ns2:order_number>
         <ns2:order_status>Shipped</ns2:order_status>
         <ns2:order_inv_number>648290076</ns2:order_inv_number>
         <ns2:order_inv_amt>32</ns2:order_inv_amt>
         <ns2:order_freight_charge>0</ns2:order_freight_charge>
         <ns2:item_Data>
              <ns0:vendor_item_number>1</ns0:vendor_item_number>
              <ns0:quantity_ordered>1</ns0:quantity_ordered>
              <ns0:quantity_shipped>1</ns0:quantity_shipped>
              <ns0:unit_cost>15</ns0:unit_cost>
              <ns0:extended_cost>32</ns0:extended_cost>
              <ns0:package_id>1</ns0:package_id>
         </ns2:item_Data>
         <ns2:package_Data>
              <ns0:package_id>1</ns0:package_id>
              <ns0:package_Items>
                   <ns0:vendor_item_number>1</ns0:vendor_item_number>
                   <ns0:quantity_shipped>1</ns0:quantity_shipped>
              </ns0:package_Items>
              <ns0:TrackingNo>
                   <ns0:TrackingNum>123456789</ns0:TrackingNum>
              </ns0:TrackingNo>
         </ns2:package_Data>
    </ns1:order>

    Hi Vlad,
    Thanks for the Idea, I tried using the Choice Condition and I am not sure what would be the condition, in my case, there are 3 record, the value in SKU will vary and differentiate the records. The first record (s) (based on no.of items in an order), the value in SKU column will be any value (alpha/numeric/alphanumeric), the next record will have "DS" in the SKU column and the next one will will "Shipping" in the SKU column. The example does look for "Yes" or "No" starting from the "70"th character in the line. I am not sure how to accommodate the condition to check whether the column* "SKU" contains an Item Number or "DS" or "Shipping". The poistion of the column "SKU" may vary every time, so I am not sure how to add a condition to verify that.
    Here is the Schema when I used "Delimited" in the choice condition,
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://TargetNamespace.com/InboundService"
    targetNamespace="http://TargetNamespace.com/InboundService"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:version="NXSD"
    nxsd:stream="chars"
    nxsd:encoding="US-ASCII"
    nxsd:hasHeader="true"
    nxsd:headerLines="1"
    nxsd:headerLinesTerminatedBy="${eol}"
    >
    <xsd:element name="OrderDetail">
    <xsd:complexType>
    <xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="terminated" nxsd:terminatedBy=","*>
    <xsd:element name="ItemsRecord" type="tns:Items" nxsd:conditionValue="(!= DS) and (!= Shipping)" />
    <xsd:element name="DSRecord" type="tns:ProcessingFee" nxsd:conditionValue="DS" />
    <xsd:element name="ShippingRecord" type="tns:ShippingInfo" nxsd:conditionValue="Shipping" />
    </xsd:choice>
    </xsd:complexType>
    </xsd:element>
    <xsd:complexType name="ShippingInfo">
    <xsd:sequence>
    <xsd:element name="OrderDetails" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="VendorID" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="PurchaseOrderNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="RefNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="OrderStatus" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceAmt" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="FreightCharge" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="" />
    <xsd:element name="ProcessingFee" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="SKU" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTY" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYOrdered" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYShipped" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Price" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Net" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TotalNoBoxes" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxNo" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWidth" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxHeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxLength" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="ShipMethod" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TrackingNumber" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="StatusDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Items">
    <xsd:sequence>
    <xsd:element name="OrderDetail" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="VendorID" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="PurchaseOrderNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="RefNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="OrderStatus" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceAmt" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="FreightCharge" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="ProcessingFee" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="SKU" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTY" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYOrdered" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYShipped" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Price" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Net" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TotalNoBox" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxNo" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWidth" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxHeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxLength" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="ShipMethod" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TrackingNumber" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="StatusDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ProcessingFee">
    <xsd:sequence>
    <xsd:element name="OrderDetail" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="VendorID" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="PurchaseOrderNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="RefNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="OrderStatus" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceNum" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="InvoiceAmt" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="FreightCharge" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="ProcessingFee" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="SKU" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTY" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYOrdered" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="QTYShipped" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Price" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Net" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TotelNoBoxes" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxNo" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxWidth" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxHeight" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="BoxLength" type="xsd:float" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="ShipMethod" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="TrackingNumber" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="StatusDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    I thank you once again for your valuable ideas and suggestions.
    Thanks,
    Venkatesh

  • Can we refer to any libraries from the BPM project?

    Hi,
    I am trying to create some BPM processes using the studio. And i wanted to refer some jar files for it. Is there any way how we can do that?
    I tried adding the jar files through the catalog. But i am not able to add some big jar files. It is throwing the OutOfMemory errors.
    Anybody please help me how to resolve that?
    Also please tell me if we can refer some external libraries?
    Can we prepare some XMLObject from a string and validate it against the schemas/xmlbeans? Is there a way in BPM to do that?
    Thanks & Regards
    Prakash.

    How much memory do you have on your machine? Are you using a VM environment? If so, how much physical (not virtual) memory do you have dedicated.
    The logic below is used to convert a String to an XML object if you haven't first introspected the XML's XSD.
    String xmlString;
    Fuego.Xml.XMLObject xmlObject;
    // Set XML String
    xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                         "<invoice>" +
                             "<customer>John Doe</customer>" +
                             "<orderdate>May 26, 2009</orderdate>" +
                             "<shipDate>May 27, 2009</shipDate>" +
                             "<serviceDescription>SOME SERVICE</serviceDescription>" +
                             "<serviceAmount>1000.0</serviceAmount>" +
                             "<taxes IVA=\"21%\">210.0</taxes>" +
                             "<total>1210.0</total>" +
                         "</invoice>";
    // Convert XML String to XML Object
    xmlObject.load(xmlText : xmlString);
    // Display values
    display(xmlObject.selectString(xpath : "customer"));Probably more what you're looking for is to first introspect the XSD for the XML (create a new module in the catalog ("MyModule" in the logic below) -> right mouse click the module -> click "Catalog Component" -> "XML Schema"). Once you've introspected the XSD, create an heir object by first expanding the XML schema you just introspected in the catalog -> right mouse click the highest level node in the XSD (e.g. "Invoice" in the XML shown below) -> click "Create Heir" and give it a name (e.g. "MyInvoice" in the logic below). You could then use the heir's load() method to load and validate the string going into the XML object like this:
    String invoiceString;
    MyModule.MyInvoice myInvoice;
    // Set XML String
    invoiceString= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                         "<invoice>" +
                             "<customer>John Doe</customer>" +
                             "<orderdate>May 26, 2009</orderdate>" +
                             "<shipDate>May 27, 2009</shipDate>" +
                             "<serviceDescription>SOME SERVICE</serviceDescription>" +
                             "<serviceAmount>1000.0</serviceAmount>" +
                             "<taxes IVA=\"21%\">210.0</taxes>" +
                             "<total>1210.0</total>" +
                         "</invoice>";
    // Convert the invoice XML String to Invoice XML Object
    myInvoice.load(xmlText : invoiceString);Dan

  • Need Help in XSL

    I want to generate HTML from a XSD file by using XSL.
    Here is a example of how the XSD file could look.
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
    targetNamespace="http://www.publishing.org"
    xmlns="http://www.publishing.org"
    elementFormDefault="qualified">
    <xsd:element name="BookCatalogue">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Book" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="Author" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="Date" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="ISBN" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="Publisher" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    in other words the XSD file is variable, i.e. could be any
    file. i.e. In stead of the <xsd:element name="Book" > it could well be <xsd:element name="Baseball" >.
    So what I need is a XSL script which could dynamically process any XSD file i.e.in the code :
    value-of select="BOOK" it could be
    value-of select="a variable" an the varivble is the one which comes from the xsd file whichever is supplied.
    Any code samples or any form of help is appreciated.
    Thanks

    Well Actually,
    I need to generate the HTML with blank fields, based on the schema first, supplying a template into it.
    Then next step is of course to populate it with data from the XML file containing the actual data. That's why ...
    Thanks for ur response.
    -Ram

  • Flex 4 Web Service Introspection For Dynamic WSDL Locations

    In Flex 3, introspecting a web service resulted in a constructor that allowed the location of the web service to change at runtime.  It appears that the Web Service introspection tool now only allows the single WSDL URI that was specified in the WS Wizard.  It this the case or am I just missing something?
    Flex 3 introspected services would create a service class with the following constructor signatures:
    private var service:MyWebService;
    service= new MyWebService(null, wsdlLocation);  // With parameters
    or you could use:
    service = new MyWebService(); //with no parameters
    In Flex 4, it appears that you can only use:
    service = new MyWebService();
    So if you don't know the web server location until runtime, am I going to need to manually override the instrospected/generated _super_MyWebService.as class in order to get back the ability to point to different servers at runtime?
    Anyone know why this has changed, or what the "new" way the Flash Builder 4 web service introspection tool uses for dynamic servers?
    Thanks a bunch!

    In Flex 4, it appears that you can only use:
    service = new MyWebService();
    add
    service.wsdl = "your wsdl";
    However if you want this to work you have to remove the hardcoded wsdl from the
    superclass otherwise it will not reset it,
    C

  • Dynamic Reference to Registered XSD

    I generate docs from SELECT like this,
    <span style="color:red;">(I do not store this type of doc in DB/XDB)</span>:
    <div style="color:blue;">
    SELECT '&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;' || chr(10) ||
    xmlelement
    (&quot;ReinsuranceXfer&quot;,
    xmlattributes
        ('http://blah.com/blah2/types/common' AS &quot;xmlns&quot;,
         'http://www.w3.org/2001/XMLSchema-instance' AS &quot;xmlns:xsi&quot;,
         'http://blah.com/blah2/types/common http://blah3/xmlschemas/Sales_v1.xsd'
         AS &quot;xsi:schemaLocation&quot;),
     xmlelement
        (&quot;SalesTransactions&quot;,
         xmlattributes('DirectTransactions' AS &quot;xsi:type&quot;).......
    </div>
    the schema &quot;Sales_v1.xsd&quot; is XDB-registered.
    In stead of hard-coding <strong>&quot;Sales_v1.xsd&quot;</strong> in PL/SQL or View definition
    I want to DYNAMICALLY reference the value, so when I switch to
    version 2, registering the new schema (deleting the old one)
    the value <strong>&quot;Sales_v2.xsd&quot;</strong>
    can be dynamically referenced.
    Is there a better/&quot;smarter&quot; way to achieve the dynamic reference
    than this ?
    <div style="color:blue;">
    SELECT substr(any_path, instr(any_path, '/', -1) + 1) xsd
        FROM resource_view
       WHERE any_path LIKE '%Sales%.xsd';
    </div>
    thanks
    10gr2

    You can't invoke methods on bits of String as if they were references to objects. (Java isn't like PHP in this regard.)
    You can, however, use arrays as db suggested.
    Let's say I have a hundred toggle buttons. I might give them names like "okButton" "exitButton" etc. Or I might make them elements of an array of buttons, buttonArr.
    And I have a method toggle(int) that accepts an integer as input and verifies that the argument is within the range 1 to 100, throwing an exception if it is not. This method is intended to select the toggle button that corresponds to the integer it receives as input as selected. So the method would be implemented as
    buttonArr.setSelected(true);

  • Dynamic XSD Mapping?

    Is it possible to make some kind om dynamic mapping from one XSD to another, based on some metadata stored for instance in DB table? The table could info like "field1 goes to fieldX".
    How can acomplish something like that?
    I know I could do in PL/SQL - parsing the incomming XSD and do some replacements. But this is not very elegant - there must be a cleaner way to handle this?
    Rgds, Henrik

    Thanx for the answer James ;-)
    I think I have to elaborate a little. the system we're building should be able to handle different input schemas (xsd). This means that i Can't /won't build a transformation for each xsd. furthermore; we're using a canonical model - so the task is basically to map the source xsd to the canonical target xsd. Since the source xsd can change dynamically - we have a setup telling which element goes to which element in the canonical model. The only solution I can come up with, is to use either Java or PL/SQL - to do the replacements/building the canonical schema.
    Rgds, Henrik

  • Constructing XML from XSD dynamically

    HI All.,
    can any one tell me how to generate a xml file with the given xsd (we don't know abt xsd ,this can be any type of xsd).this means dynamic generation of xml file with the given xsd using java.
    More Explanation abt the problem:
    Bye pointing the path xsd file..we need to show them an sample xml file.
    any suggestion highly appreciated.
    Thanks
    Kim.

    The simplest approach would be to take the XSD, run it through JAXB, use reflection to populate the generated objects, and then marshall to XML. However, there are likely to be a number of edge cases where this will fail. It's also fairly straightforward to parse the XSD and construct a transformation engine that does the right thing for simple XML, but again, the edge cases (think xsd:choice will cause problems).
    However, I can't help but wonder if this is really useful? While you can auto-generate syntactically valid documents, there's also semantic meaning that would be important to anyone using those documents. Throwing a random string of characters into an element defined as xsd:string probably isn't going to be useful if you want to generate XML containing a name and address.

  • Dynamic generation of HTML based on XML/XSD

    Hi
    I'm looking for a way to generate HTML from various XMLand/or XSD Files. What I want is a generic mechanism that can generate an HTML page from a random XML/XSD File.
    I have one or two ideas, but I'm interested in what others have done so far.
    Questions:
    - Has anybody already made something like this?
    - Is there some free ware API to support this?
    Thanks!

    you can generated the html dynamically and store it in a ABAP variable and use it in your layout
    but in your case one of the best ways you could handle is store the user selections in an internal table. (which can hold the check box number and an indicator whether that should be rendred or not)
    then in the layout write
    <% loop at itab into wa where render = 'X'. %>
    htmlb:checkbox  id= ....
    <% endloop. %>

  • How to bind dynamic xml with Java objects without xsd

    have a question, and hope someone here can help me.
    In my current project, I will get a xml file, containing some information of each user, and map them into a set of user objects.
    For each user, there are some fixed attributes, such as name, phone#, age, position, etc. The problem is, client can customize, and add new attibutes, such as address, favorite color, so there will be no xsd for the xml.
    What I want to do, is map fixed attributes to user object attributes, for example, name attribute to User.name, and they will have corresponding getters, and setters, but for custom attributes, I want to add them to a HashMap in User object, for example, use string "ADDRESS" as the key, and address as the value.
    Is there any way I can do this? Thank you very much for any help you can provide.

    It would not be too hard to do in regular code.
    First, make a HashSet with the Strings for the names of the known attributes that will be processed with setters.
    Then, get the NamedNodeMap via getAttributes(). That will give you all attributes -- both the ones you will handle with your setters and the ones you will handle via a HashMap.
    Then, loop through the NamedNodeMap. For each attribute, get the name and value. If the name is in the HashSet of known values, process it with a list of
    if ( attName.equals( "name" ))
        whatever.setName( value );
       continue;
    }If it is not in the HashSet, then set the value into your HashMap with the name and value.
    There is no standard way to do this.
    Dave Patterson

Maybe you are looking for

  • PL/SQL vs SQL

    What are the fundamental differences between PL/SQL and SQL?

  • Cross company sales with multiple operating concern

    Hi all, I'm going to implement cross company sales in a system that is already live. I think that it really fit to the new requirement of the client , that want to allow the possibility of creating a sales order from sales organization A1 of company

  • E-Filing UK in ECC6 without XI / PI ?

    Hello, We did a releasechange from 4.7 to 6.0 and according to the SAP help files and other information it's not longer possible to send EOY and other forms to HMRC by using the business connector. It has to be done now with XI/PI (Exchange Infrastru

  • Data inconsistency :Virtual Uid cannot be found

    Hi, I have some restricted Kfs and calaculated kfs in my query when I try to save it gives me the error Data inconsistency :Virtual Uid cannot be found Sany

  • Report text background color

    I have added report text to my post-expression to display voltage test results.  I want to be able to change the background color of the report text frame so that only failures stand out in the report.  It currently defaults to magenta.  Here is an e