Validate if XML in clob well form

Hi,
Is there any function can be used to validate if xml store in clob field well form ?
Thanks
Vincent

SQL> set serverout on
SQL> DECLARE
  2    v_clob   CLOB := '<?xml version="1.0"?>
  3                      <ROWSET>
  4                      <IBSCOLYTD>
  5                      <ACTNOI>28004125</ACTNOI>
  6                      <MEMONOI>251942</MEMONOI>
  7                      <MEMODTEI>05-SEP-92</MEMODTEI>
  8                      <AMOUNTI>400</AMOUNTI>
  9                      <BRCDSI>513</BRCDSI>
10                      <TYPEI>1</TYPEI>
11                      <TRANSMONI>0</TRANSMONI>
12                      </IBSCOLYTD>
13                      <IBSCOLYTD>
14                      <ACTNOI>28004125</ACTNOI>
15                      <MEMONOI>251943</MEMONOI>
16                      <MEMODTEI>04-OCT-92</MEMODTEI>
17                      <AMOUNTI>400</AMOUNTI>
18                      <BRCDSI>513</BRCDSI>
19                      <TYPEI>1</TYPEI>
20                      <TRANSMONI>0</TRANSMONI>
21                      </IBSCOLYTD>
22                      ';
23    l_parser DBMS_XMLPARSER.Parser;
24  BEGIN
25    -- Create a parser.
26    l_parser := DBMS_XMLPARSER.newParser;
27    -- Parse the document
28    DBMS_XMLPARSER.parseClob(l_parser, v_clob);
29    DBMS_XMLPARSER.freeParser(l_parser);
30    DBMS_OUTPUT.put_line('Parsing Success');
31  EXCEPTION
32    WHEN OTHERS THEN
33      DBMS_OUTPUT.put_line('Parsing failed');
34      DBMS_XMLPARSER.freeParser(l_parser);
35   
36  END;
37  /
Parsing failed
PL/SQL procedure successfully completed.
SQL> DECLARE
  2    v_clob   CLOB := '<?xml version="1.0"?>
  3                      <ROWSET>
  4                      <IBSCOLYTD>
  5                      <ACTNOI>28004125</ACTNOI>
  6                      <MEMONOI>251942</MEMONOI>
  7                      <MEMODTEI>05-SEP-92</MEMODTEI>
  8                      <AMOUNTI>400</AMOUNTI>
  9                      <BRCDSI>513</BRCDSI>
10                      <TYPEI>1</TYPEI>
11                      <TRANSMONI>0</TRANSMONI>
12                      </IBSCOLYTD>
13                      <IBSCOLYTD>
14                      <ACTNOI>28004125</ACTNOI>
15                      <MEMONOI>251943</MEMONOI>
16                      <MEMODTEI>04-OCT-92</MEMODTEI>
17                      <AMOUNTI>400</AMOUNTI>
18                      <BRCDSI>513</BRCDSI>
19                      <TYPEI>1</TYPEI>
20                      <TRANSMONI>0</TRANSMONI>
21                      </IBSCOLYTD>
22                      </ROWSET>     
23                      '; --The last line added to make it ok.
24    l_parser DBMS_XMLPARSER.Parser;
25  BEGIN
26    -- Create a parser.
27    l_parser := DBMS_XMLPARSER.newParser;
28    -- Parse the document
29    DBMS_XMLPARSER.parseClob(l_parser, v_clob);
30    DBMS_XMLPARSER.freeParser(l_parser);
31    DBMS_OUTPUT.put_line('Parsing Success');
32  EXCEPTION
33    WHEN OTHERS THEN
34      DBMS_OUTPUT.put_line('Parsing failed');
35      DBMS_XMLPARSER.freeParser(l_parser);
36   
37  END;
38  /
Parsing Success
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • XML-error: Not well-formed (invalid token)

    Hello,
    I want a new XML structure in the Script from my InDesign CS6 (MAC 10.7.4) document. Here ist my little testscript:
         var doc = app.documents.item(0);
         var allStories = doc.stories;
        newXML = new XML('<root></root>');
        for(var i = 0; i < allStories.length; i++) {
            var curStory = allStories[i];
             for(var j = 0; j < curStory.textStyleRanges.length; j++) {
                var textStyleRange = curStory.textStyleRanges[j];
                alert(textStyleRange.contents);
                t = new XML('<content>' +textStyleRange.contents + '</content>');
                newXML.appendChild(t);
        alert(newXML);
    The document has a text frame with the text, such as "C & A". When the script starts, it shows me the error message "XML-error: Not well-formed (invalid token)" on.
    The problem with the "&" is. Probably also other Characters.
    I think InDesign can automatically convert this into "&amp;" or other entities, but how?

    I solved the Problem.
    The line with
    t = new XML('<content>' +textStyleRange.contents + '</content>');
    is the Problem. textStyleRange.contents is not converted. The right way is here for the line:
    t = new XML('<content></content>');
    t.appendChild(textStyleRange.contents);

  • Could not initiate the BPEL process :the input xml is not well formed err

    Hi
    I am calling a bpel process from the bpel console. It is a syncronous process and just fetches values from the database. I see that when ever i call this for some inputs i get the following error , in the response.
    Could not initiate the BPEL process because the input xml is not well formed, the reason is :
    Error parsing envelope: (1, 6168) Invalid char in text. Please correct the input xml.
    When i see the log i have the following message
    fault.collaxa.cube.ws> <AdapterFramework::Outbound> Returning outbound XMLRecord for OutputParameters
    Exception: Error parsing envelope: (1, 6168) Invalid char in text.
    e.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:103)
    e.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:76)
    e.ws.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:935)
    ate__ws._jspService(_ngDoInitiate__ws.java:455)
    erver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    .runtimev2.JspPageTable.service(JspPageTable.java:453)
    .runtimev2.JspServlet.internalService(JspServlet.java:591)
    .runtimev2.JspServlet.service(JspServlet.java:515)
    let.http.HttpServlet.service(HttpServlet.java:856)
    nd.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    urity.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
    ity.AccessController.doPrivileged(Native Method)
    rity.auth.Subject.doAsPrivileged(Subject.java:517)
    I understand that the error is coming with parsing the output from the database values. Further i see the process is completed successfully when i see the flow and log and the out is present in the output response. Has any body faced this issue. What is that character that it is nto able to parse as the error says.
    Thanks
    -Pradip

    hi
    I have tried it using both xml and the initiate tab. I get the same error every time i do it for a particular value. i further think that this is occuring for the out put response that is got from the data base as the log says. ( given in the initial post). I can surely paster the input xml for you
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/top/InputXXESIOEHEADERSIFACE">
    <ns1:XxesiOeHeadersIfaceCollection>
    <ns1:XxesiOeHeadersIface>
    <ns1:orderSource></ns1:orderSource>
    <ns1:originalsystemreference></ns1:originalsystemreference>
    <ns1:customerNumber></ns1:customerNumber>
    <ns1:Country></ns1:Country>
    </ns1:XxesiOeHeadersIface>
    </ns1:XxesiOeHeadersIfaceCollection>
    </soap:Body>
    </soap:Envelope>

  • Xml is not well formed and caller ID issues

    XML is not well formed happens when i click on links from facebook mobile...links to youtube videos, or any other external links. This used to work before, just started happening out of nowhere.
    Also, caller ID doesnt display names from contacts, just the number they are calling from...1-10 calls will show the contact name.
    any information would be great, thank you!

    Since you have a "BlackBerry Browser" I'm assuming you're on a BES?  Have you talked with your IT department?  Is the device locked when the caller ID doesn't work?  Do you have content protection enabled? 
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • "Could not initiate the BPEL process because the input xml is not well form

    hi all,
    i am new to BPEL and tring to create a BPEL WebServices. now i got struck up with one issue like below
    "Could not initiate the BPEL process because the input xml is not well formed, the reason is : Error parsing envelope Please correct the input xml."
    But according to BPEL compiler there are no errors in the design and deployment as well. when i tries to initiate the deployed WS i am facing the above issue.
    can anybody help me to fix this issue. Thanks in advance.
    Regards,
    Kalyan

    hi' Kalyan,
    The issue seems to be due to XSD file which you are importing while making the new BPEL process,
    the XSD file is very sensitive even a simple upper case will create error, XSD file are many times used when you want
    to pass some entries to be updated in the database.
    use this XSD file:"discountflow.xsd"
    <schema attributeFormDefault="qualified"
    elementFormDefault="qualified"
    targetNamespace="http://www.autoloan.com/ns/autoloan"
    xmlns:tns="http://www.autoloan.com/ns/autoloan"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <!--<element name="Demo" type="tns:DemoType"/>-->
    <element name="Order" type="tns:OrderType"/>
    <complexType name="OrderType">
    <sequence>
    <element name="orderid" type="int"/>
    <element name="tenantid" type="int"/>
    <element name="orderstatusid" type="int"/>
    </sequence>
    </complexType>
    </schema>
    <complexType name="Discount">
    <sequence>
    <element name="approval" type="boolean"/>
    <element name="discount" type="int"/>
    <element name="quantity" type="int"/>
    </sequence>
    </complexType>
    </schema>
    -Yatan

  • Could not initiate the BPEL process because the input xml is not well forme

    Your test request generated the following exception/fault:
    Could not initiate the BPEL process because the input xml is not well formed, the reason is :
    Error parsing envelope: (2, 152) Invalid char in text. Please correct the input xml.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/RO_Update2">
    <ns1:RO_Update2ProcessRequest>
    <ns1:UserName>operations</ns1:UserName>
    <ns1:Responsibility>Depot Repair Engineer</ns1:Responsibility>
    <ns1:API_VER>1.0</ns1:API_VER>
    <ns1:P_commit>T</ns1:P_commit>
    <ns1:init_msg>T</ns1:init_msg>
    <ns1:Org_ID>207</ns1:Org_ID>
    <ns1:R_Number>10782</ns1:R_Number>
    <ns1:R_Status>1008</ns1:R_Status>
    <ns1:Obj_Ver_No>1</ns1:Obj_Ver_No>
    </ns1:RO_Update2ProcessRequest>
    </soap:Body>
    </soap:Envelope>

    Try
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <ns1:RO_Update2ProcessRequest xmlns:ns1="http://xmlns.oracle.com/RO_Update2">
    <ns1:UserName>operations</ns1:UserName>
    <ns1:Responsibility>Depot Repair Engineer</ns1:Responsibility>
    <ns1:API_VER>1.0</ns1:API_VER>
    <ns1:P_commit>T</ns1:P_commit>
    <ns1:init_msg>T</ns1:init_msg>
    <ns1:Org_ID>207</ns1:Org_ID>
    <ns1:R_Number>10782</ns1:R_Number>
    <ns1:R_Status>1008</ns1:R_Status>
    <ns1:Obj_Ver_No>1</ns1:Obj_Ver_No>
    </ns1:RO_Update2ProcessRequest>
    </soap:Body>
    </soap:Envelope>

  • Client Proxy: XML message not well-formed unexpected symbol 'target

    Hi,
    I'm trying to get a client proxy to work based on several blogs (1387,1672)
    The error I'm getting now is:
    <SAP:ErrorHeader xmlns:SAP="http://sap.com/exchange/MessageFormat">
      <SAP:Context />
      <SAP:Code p1="XML message not well-formed in node (7 ,49 )unexpected symbol: 'target'" p2="" p3="" p4="">PARSING.GENERAL</SAP:Code>
      <SAP:Text language="EN">Parsing error: XML message not well-formed in node (7 ,49 )unexpected symbol: 'target'</SAP:Text>
      </SAP:ErrorHeader>
    The proxy has been generated successfully
    in SXMB_ADM R/3 role is application system and uses dest://rfc_dest
    The rfc destination does not accept ?type=entry but apparently also does not need it. When I test the connection it gives a statuscode 200 (not 500)
    SLDCHECK works fine.
    Not sure where to look for this error?
    Any ideas?
    Thanks
    Tom

    Hello Smitha,
    I forgot to mention that the message is still in R/3, it has not arrived in XI yet, so the error is visible in SXMB_MONI in R/3.
    Also it is just a dummy message, It only contains one node and that is called differently:
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:IF021_HTTP_MSG xmlns:ns1="http://oce.com/xi/eu1/R3CCSEU/IF021_Ordrsp_TD_to_Ordrsp_CCS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <IF021_DT>GetOrdRsp</IF021_DT>
      </ns1:IF021_HTTP_MSG>
    Any mappings only take place in XI itself, and even there I have no node called target.
    Regards
    Tom

  • Getting the message: "XML code not well formed"

    Hi folks!
    I'm a blackberry newbie, and I love it, but I'm having a difficult time understanding why it won't allow me to download a WAP push link to download a ringtone. Every time I try to link I get the message: "The XLM code is not well-formed". I've tried everything from resetting the default browsers to contacting the company who is sending the WAP push message-and they had to download my BlackBerry diagnostics to try and figure out why the phone wasn't accepting the code. I'm going nuts trying to figure this out because it worked on my previous phone: same carrier (T-Mobile), Samsung phone.
    Anybody have any insight into this?
    Thanks!
    Andy

    Thank you for your response!
    I did contact the site and he downloaded my blackberry diagnostics to diagnose the issue.  He was able to download it to HIS Blackberry pearl (so he said) with no problem, and finally, I was able to download the exact same ringtone from the same site to my Samsung phone a week before I purchased the BlackBerry.
    It sounds to me as if the issue is with the BlackBerry not accepting the WAP site's code the same way the Samsung did.
    I'm a complete newbie, but that's how it seems to me.  Frustrating

  • Checking if a XML Schema Is well formed

    How would I do this.
    Has anyone any sample code that does this.
    Is it a simple matter of just passing it into a parser.

    schema itself is also a xml file... W3C also a schema/DTD file for validating schema files... pretty cool, using schema to validate schema...
    here is the link:
    http://www.w3.org/TR/xmlschema-1/
    If possible, get the xsd file rather than dtd... there should be three:
    XMLSchema.xsd
    XMLSchema-datatypes.xsd
    XMLSchema-datatypes-normative.xsd

  • How to validate that XML is well-formed?

    I have an "Any XML Service" on Oracle Service Bus (version 11.1.1.4) that I would like to have validate that the input is well-formed XML. There is no DTD or XSchema to apply -- it can be any generic well-formed XML. I didn't see a way to do it with a Validate Action. Is a Java Callout my only option?
    Thanks,
    Doug Newton

    That's interesting...
    Try creating a xquery expression using fn-bea:inlinedXML(), it doesn't require XSD
    The fn-bea:inlinedXML() function parses textual XML and returns an instance of the XQuery 1.0 Data Model.
    The function has the following signature:
    fn-bea:inlinedXML($text as xs:string) as node()*
    where $text is the textual XML to parse.
    Examples:
    fn-bea:inlinedXML(“<e>text</e>”) returns element “e”.
    fn-bea:inlinedXML(“<?xml version=”1.0”><e>text</e>”) returns a document with root element “e”.
    http://docs.oracle.com/cd/E13162_01/odsi/docs10gr3/xquery/extensions.html#wp1295964
    Cheers,
    Vlad
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts)
    https://forums.oracle.com/forums/ann.jspa?annID=893

  • XML from CF not well-formed?

    I have been working through the Training from the Source book
    on Flex2 (Trapper, Boles, Talbot, etc.). In Lesson 17, it deals
    with accessing server-side objects.
    One piece of code accesses a CF template, which brings in an
    XML file:
    <mx:HTTPService id="prodByCatRPC"
    url="
    http://localhost/flexGrocer/xml/categorizedProducts.cfm"
    result="prodByCategoryHandler(event)"
    resultFormat="e4x" />
    The CF plate from the book's file has the following:
    <cfheader name="Expires" value="#now()#" />
    <cfxml variable="xProducts">
    <cfinclude template="categorizedProducts.xml">
    </cfxml>
    <cfset xmlObject=ToString(xProducts)>
    <cfcontent type="text/xml" />
    <cfoutput>#variables.xmlObject#</cfoutput>
    When run the Flex file, I get a run-time message which seems
    to indicate that the XML is not well-formed. (Here is a bit of the
    message; not sure I'm understanding it!):
    [RPC Fault faultString="Error #1088: The markup in the
    document following the root element must be well-formed."
    faultCode="Client.CouldNotDecode" faultDetail="null"]
    I am ASSUMING that the CF page is not returning the xml as
    desired, because if I simply change the flex http service call to
    the xml file that the CF page is including, the flex app runs as
    expected and without errors:
    url="
    http://localhost/flexGrocer/xml/categorizedProducts.xml"
    (something in the posting mech is making the above url
    statement messed up, but you can probably tell what I mean)
    I am a CF developer and although haven't used the book's
    exact method to get the cf generated xml, I have done so
    successfully for Spry and other things.
    I tried some ot the things I had to do to get the CF
    generated xml to work in Spry with this flex, but didn't help.
    Tried adding a reset='true" with the cfcontent tag; tried making
    the cfcontent wrap the output; added cfprocessing tags to
    suppresswhitespace.
    Appreciate any thoughts/help on how to solve this. Also,
    whether others agree that the problem is with the generated xml
    rather than something else.
    Thanks
    Keith

    I don't remember the exact context when I first posted this
    question and answered it; but, if one doesn't want to change
    overall settings for debugging in cf admin., I *think* you can
    ajust for a specific area using cfsetting and/or
    cfprocessingdirective. There's a number of attributes and
    combinations there that I think can take care of the problem. I
    forget for sure, but may want to try that, especially on a
    development box where you might generally want debugging to be on.
    Also, if using cfcs in any part of what you generate, they
    can produce whitespace. To solve (or minimize), make sure that
    output attribute in the component is false and that output in
    function is false (unless directly outputting within the function.
    Seems like CF and whitespace is an ongoing item to try to
    manage.
    Keith

  • XSLT and non-well formed XML file

    All,
    I am getting some "XML" feeds from some old lab equipment, however the XML isn't well formed.  Really it isn't even XML it is just a formatted text file.  So I will get a feed like the following:
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:20 PM" />
    <CarbonAvg Label="Carbon Avg." Value="116 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002301 1" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 11:46 AM" />
    <CarbonAvg Label="Carbon Avg." Value="43.5 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002302 2" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 11:53 AM" />
    <CarbonAvg Label="Carbon Avg." Value="44.4 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002303 3" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:00 PM" />
    <CarbonAvg Label="Carbon Avg." Value="42.6 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002322 1" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:07 PM" />
    <CarbonAvg Label="Carbon Avg." Value="32.3 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002323 2" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:14 PM" />
    <CarbonAvg Label="Carbon Avg." Value="35.8 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002324 3" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:27 PM" />
    <CarbonAvg Label="Carbon Avg." Value="32.4 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:33 PM" />
    <CarbonAvg Label="Carbon Avg." Value="123 ppm" />
    </SampleSet>
    As you can see, this isn't well formed and when I try to process this via XSLT I run into all kinds of problems.  So outside of writting a program to watch for files, picking them up with a c# program, wrapping the XML to make it well formed then pass
    it to the XSLT file, is there a way that I can wrap the file using XSLT instead of having to create a separate program to make it well formed? Any help is appreciated.

    Hello katghoti,
    >>however the XML isn't well formed.  Really it isn't even XML it is just a formatted text file
    Firstly, we should know that a text file actually does not know a XML format, so I suggest that you could save the text file to a XML file. And if you provided XML is the whole content, it is not an invalid XML file because the XML document must have one
    and only one root element. You have to add root element, so a valid XML file with these SampleSet elements should be similar with below:
    <?xml version="1.0"?>
    <SampleSets>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:20 PM" />
    <CarbonAvg Label="Carbon Avg." Value="116 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:33 PM" />
    <CarbonAvg Label="Carbon Avg." Value="123 ppm" />
    </SampleSet>
    </SampleSets>
    I am not sure how you want the XML be formatted, my usual approach to format a XML file is to open the file in Visual Studio and use ctrl K+D keyboard shortcuts to format the XML file.
    >>is there a way that I can wrap the file using XSLT instead of having to create a separate program to make it well formed?
    XSLT is used to process XML file, while you provided file is a text file, it does not recognize it.
    If I misunderstand, please feel free to let me know.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • XML Not well formed

    I have an XSLT mapping as described below:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/biztalk_1">
    <ns0:biztalk_1 xmlns:ns0="urn:biztalk-org:biztalk:biztalk_1">
    <ns0:header>
    <ns0:delivery>
    <ns0:message>
    <ns0:messageID><xsl:value-of select="header/delivery/message/messageID"/></ns0:messageID>
    </ns0:message>
    </ns0:delivery>
    </ns0:header>
    <ns0:body>
    <ns0:FinancialTransaction.CreateFromData>
    <ns0:CompanyCode><xsl:value-of select="body/FinancialTransaction.CreateFromData/CompanyCode"/></ns0:CompanyCode>
    </ns0:FinancialTransaction.CreateFromData>
    </ns0:body>
    </ns0:biztalk_1>
    </xsl:template>
    </xsl:stylesheet>
    however when I execute this mapping I keep getting the error saying that the XML is not well formed...
    I have looked at it but really cant see where I am going wrong.. Could someone take a look at the above xslt and let me know where this error could be coming from....

    ok this is the xslt again
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/biztalk_1">
    <ns0:biztalk_1 xmlns:ns0="urn:biztalk-org:biztalk:biztalk_1">
      <ns0:header>
          <ns0:delivery>
             <ns0:message>
                <ns0:messageID><xsl:value-of select="header/delivery/message/messageID"/></ns0:messageID>
             </ns0:message> 
          </ns0:delivery>
       </ns0:header>
       <ns0:body>
          <ns0:FinancialTransaction.CreateFromData>
             <ns0:CompanyCode><xsl:value-of select="body/FinancialTransaction.CreateFromData/CompanyCode"/></ns0:CompanyCode>
          </ns0:FinancialTransaction.CreateFromData>
       </ns0:body>
    </ns0:biztalk_1>
    </xsl:template>
    </xsl:stylesheet>
    and the source will look something like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:biztalk_1 xmlns:ns0="urn:biztalk-org:biztalk:biztalk_1">
       <ns0:header>
          <ns0:delivery>
             <ns0:message>
                <ns0:messageID/>
                <ns0:sent/>
             </ns0:message>
          </ns0:delivery>
       </ns0:header>
       <ns0:body>
          <ns0:FinancialTransaction.CreateFromData>
             <ns0:CompanyCode/>
          </ns0:FinancialTransaction.CreateFromData>
       </ns0:body>
    </ns0:biztalk_1>
    There are actually more fields but this is a toned down version...

  • Java Bean to check for Well-formed  XML DOC?

    Hi All,
    I am new to the Java XML API's. Does anyone have an example of
    a Java Bean that i can pass an XML String and check if the
    XML document is well formed?
    Thanks
    Joe

    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(xmlString)));try/catch this ugly line, if no parse exception and a non -null doc exists then your XML is well-formed.
    of course if your XML contains namespaces, you would have to setup correctly the document builder.

  • SAXException while parsing a well formed XML

    Hi all,
    I am getting SAXException while parsing even though my XML is well formed.
    It is written in the API that SAXException can be thrown for both error and warning. Is there any way to ignore the warnings coming while parsing and hence no SAXException is thrown.
    One more weird behavior I am getting is that when I catch the SAXException, it executes the catch block and after that control goes to the next line from where the exception was thrown, and that line is in try block itself. I'll show this with code example:
    1.     Try {
    2.        DocumentBuilder docBuild = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    3.        Document document = docBuild.parse( inputSrc );      //SAXException is thrown on this line
    4.        //Some code�
    5.     �
    6.     } catch (Exception e) {
    7.        System.out.println(�Exception while parsing: �+e.getMessage);
    8.     }
    9.     //Some Code�Ideally when SAXException is thrown on line 3, control should go to the line 7 and the to line 9 after the catch block. But in current senario control is going to line 4 after line 7. It is something very strange happening. My guess is, is it because of some property of SAXException, when thrown for warning?
    Any suggetion/advice in this regard will be helpful.
    Thanks in advance

    First: if an exception is happening, then your XML isn't well-formed. Look at the exception text and see what it's complaining about.
    As for why you're not catching the exception: a DocumentBuilder uses an ErrorHandler to handle the different warnings and errors. You can set your own ErrorHandler when parsing. The default (as documented in the link above) simply writes warnings and non-fatal errors to the console, and throws an exception only for fatal errors.

Maybe you are looking for

  • Sharing the same keychain across multiple user accounts

    Hello, Anyone know how to do this? Thanks in advance!

  • Suid: Problem with dynamic linker

    Hi, i have a multithread program that is compiled with the additional option "-xarch=v8plus". The consequence is, that the following library /usr/lib/cpu/sparcv8plus/libCstd_isa.so.1 is linked. When i set the permission "suid" to the programm and cal

  • TS3775 Target Display Mode doesn't work

    I have a similar issue. I am trying to connect iMac 27" to Macbook Pro 13" (both 2011 models). I am using mini displayport Male-Male cable to connect both computers. After connecting I have pressed Command + F2 key but nothing happens. Any suggestion

  • New Depreciation Area after go-live

    Hi Gurus We are on ECC 6.0 in a production environment having gone live in April 2008. We had gone live with only Depreciation Area 01. Other depreciation areas were de-activated. We have a requirement now to create a new depreciation area 15 for Inc

  • Do not synchronize and remove from my PC

    So far I am not able to achieve a specific wish in Thunderbird. I want to be able to remove e-mails on my webmail after I have them available within Thunderbird; the problem is that if I do so now, the same e-mail I delete in webmail, disappears in T