XML element tag problem

Hi guys,
I am facing a problem in parseing a XML file when the element is in <element/> tag format. Iam using "javax.xml.parsers.SAXParser" to parse the XML. Basically XML contains many fields that are mandatary in my XSD. my requirement is that if there is a SAXParseException, I should get the name of the element for which the error is comming.
What I am doing is, I am storing the name of the element in startElement method, which I print it in the catch block of the error. This code is working fine for <element></element> type of tag. But when the element tag is <element/> this. it does not go in the startElement or endElement block. Hence I always get the name element which is previous to the error element.
How can I get the element name in both form of the element tag. As I have no control over the XML, which is posted on my servlet.

I'm not sure why you're having a problem - the SAXException tells you where in the input stream the error is, and SAX parsers may report a validation error at any time so long as it is before passing the invalid element to the content handler. So it's legal for the exception to occur immediately after the startDocument, and will not necessarily occur immediately after the callback for the preceding element.
Eg, if the DTD says you have <!ELEMENT foo (a,b,c,d)> and you have <foo><a/><b/><x/><d/></foo>, then the parser may well report the error before the startElement() call for the foo element, as it is invalid. Such fail-fast parser validation means you can safely update a persistant resource on receipt of the events, rather than having to wait until the element is closed before you are sure it's valid.
This works fine for <element/> tag. But now there is a problem with <element></element> tag.Post the code you have, show how you are mapping from the line no. in the exception to the source data, and state which parser you are using.
Pete

Similar Messages

  • Error While trying to Get XML element(tag) Values

    We are trying to get XML element (TAG) value from the XML pay load.
    Example.
    Getting XML String from a web service and then converting into XML payload.
    ora:parseEscapedXML(bpws:getVariableData('signOn_Out','signOnReturn'))
    From this XML payload we are trying to get an element (Tag) value.
    We are getting following error
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@118dc2a
    {http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Here are signOnReturn and XML Payload XSD's
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web1"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="Web1ProcessRequest">
              <complexType>
                   <sequence>
                        <element name="userName" type="string"/>
    <element name="password" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="Web1ProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    <?xml version="1.0" encoding="windows-1252" ?>
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="TProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
    <element name="User">
    <complexType>
                   <sequence>
                        <element name="Id" type="string"/>
    <element name="CompanyId" type="string"/>
    <element name="SecurityToken" type="string"/>
    <element name="FirstName" type="string"/>
    <element name="LastName" type="string"/>
    </sequence>
    </complexType>
    </element>
                   </sequence>
              </complexType>
         </element>
    </schema>

    I am sure and can see the data in audit trail.
    [2006/12/12 09:17:36]
    Updated variable "signOn_Output"
    - <signOn_Output>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <WebMethodsProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </WebMethodsProcessResponse>
    </part>
    </signOn_Output>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "tririga"
    - <tririga>
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </tririga>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "Variable_2"
    - <Variable_2>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </part>
    </Variable_2>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@1c8768e
    Copy details to clipboard
    [2006/12/12 09:17:36]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Copy details to clipboard

  • How to refer ?XML element tag name? in the RTF variable

    Hi All,
    I want to declare variable and assign the value of XML element tag to that variable.
    Following are the steps:
    <?xdoxslt:set_variable($_XDOCTX, MYCOUNT,1)?>
    <?xdoxslt:get_variable($_XDOCTX, MYCOUNT)?>
    <?if: xdoxslt:get_variable($_XDOCTX, MYCOUNT) =1?>xxx<?end if?>
    In the declaration part,I need to replace 1 with some of the xml element tag value(for example : <?vendor_name?>).
    But when I try to do so,I get some list of exceptions.
    Please suggest how to proceed.
    Thanks and Regards,
    Kaveri

    Hi Pradeep,
    Thanks for your response.Here my requirement goes:
    for -each:
    text(database value)
    end for-each
    This text value will continue from page 1 to N.
    So for page1 I want HEADER1 and from page2 onwards,I require different header HEADR2.
    By using your approach,my text which needs to be continued on different pages will not be acheived.
    One more thing I got from XMLP User guide:
    <xdofo:inline-total
    display-condition="exceptfirst"
    name="InvAmt">.
    SInce all my tags are generated from Oracel reports,I am unable to use the above xml line.Is there any way to use this by modifying the syntax..
    Please let me know your suggestions since this is show stopper for my report.
    Thanks and Regards,
    Kaveri

  • Create XML Element Tag BasedOn Found Character Style

    Hi,
    Good Day!
    Basically I want to search only for character styles that contains "ntb-", that is why it is hard coded in my searchString variable.
    Although I was able to create XML tag based on selected character style, but it will always add/insert at the end of the parent XML element.
    Can anyone could help me how insert/add that element at the insertion point where the text is found?
    Thanks,
    --elmer
    var myDoc = app.documents[0];
    myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.POINTS;
    myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.POINTS;
    var charStyles = myDoc.allCharacterStyles;
    var foundStyles = Array();
    var searchString = String();
        searchString = 'ntb-';
    var tempName = String();
    var tempName1 = String();
    for(var i = 1; charStyles.length > i; i++){
       tempName = charStyles[i].name;
       tempName1 = tempName.toLowerCase();
       if(tempName1.indexOf (searchString.toLowerCase()) != -1){
           foundStyles.push (tempName);
    var myDialog = app.dialogs.add({name: "Convert Footnote Character Styles to XML Tags",canCancel:true});
    with (myDialog) {
        with (dialogColumns.add().borderPanels.add()) {
            with (dialogColumns.add()) {
                staticTexts.add({staticLabel: "Character style to search : "});        }
            with (dialogColumns.add()) {
                selCharStyle = dropdowns.add({stringList: foundStyles, selectedIndex: 0, minWidth: 175});
    var dialogShown = myDialog.show();
    while (dialogShown) {
        if (selCharStyle.selectedIndex == 0) {
            alert("Must have at least a character style to search!");
            dialogShown = myDialog.show();
            continue;
        } else {
            insertXMLTags(selCharStyle.stringList[selCharStyle.selectedIndex], selCharStyle.selectedIndex, "0");
            break;
    myDialog.destroy();
    alert("Finished!");
    exit();
    function insertXMLTags(cStyle, cStyleIndex, ip) {
        var myFinds = searchStyle(cStyle, cStyleIndex);
        for (i=myFinds.length - 1; i>=0; i--) {
            var myIP = myFinds[i].texts.item(0).insertionPoints.item(0);
            var myParentXML = myIP.associatedXMLElements[0];
            var myChiidXML = myParentXML.xmlElements.add ( cStyle );
            myChiidXML.contents =  myFinds[i].contents;
            //set the selection
            app.selection = myFinds[i].texts.item(0);
            //remove the selected text
            myFinds[i].texts.item(0).remove();
            Utility Functions         
    function searchStyle(cStyle, cStyleIndex){
        var myFinds;
        // if script version is for Indesign CS2
        if (app.scriptPreferences.version < 5){                                 
            app.findPreferences = NothingEnum.nothing;
            app.changePreferences = NothingEnum.nothing;
            myFinds = myDoc.search(undefined, undefined, undefined, undefined,
            {appliedParagraphStyle: pStyle, appliedCharacterStyle: cStyle});
        // else, for CS3 and CS4
        }else{                                 
            //Clear any existing find/change settings
            app.findTextPreferences = NothingEnum.nothing;
            app.changeTextPreferences = NothingEnum.nothing;
            // set character or paragraph style to search
            if (cStyleIndex != 0){ 
                app.findTextPreferences.appliedCharacterStyle = cStyle;
            //Set the find options.
            app.findChangeTextOptions.caseSensitive = false;
            app.findChangeTextOptions.includeFootnotes = true;
            app.findChangeTextOptions.includeHiddenLayers = false;
            app.findChangeTextOptions.includeLockedLayersForFind = false;
            app.findChangeTextOptions.includeLockedStoriesForFind = false;
            app.findChangeTextOptions.includeMasterPages = false;
            app.findChangeTextOptions.wholeWord = false;                             
            myFinds = myDoc.findText();
        return myFinds;

    Here is a way you can find any field.
    Download the current template.
    Open it in word and go to the line that you are interested in.
    The blanket PO# will be a field. Right click on it and go to properties. You will see the xml element there.
    Hope this answers your question,
    Sandeep Gandhi

  • XML elements nesting problems

    Hi,
    Is it possible to create an XML report with 2 or more XML
    elements in the same level? I was trying to do it with groups in
    data model but I can't do it.
    e.g.
    <report>
    <block1>
    <element1>A</element1>
    <element2>B</element2>
    </block1>
    <block2>
    <element3>A</element3>
    <element4>B</element4>
    </block2>
    </report>
    thanks in advance,
    Natxo Cabri
    [email protected]

    Hi,
    Is it possible to create an XML report with 2 or more XML
    elements in the same level? I was trying to do it with groups in
    data model but I can't do it.
    e.g.
    <report>
    <block1>
    <element1>A</element1>
    <element2>B</element2>
    </block1>
    <block2>
    <element3>A</element3>
    <element4>B</element4>
    </block2>
    </report>
    thanks in advance,
    Natxo Cabri
    [email protected]

  • Making XML elements (tags+attributes) visible in layout for PDF and print. Possible?

    Is it possible to have the XML structure (tags and attributes) be made visible and formatted in the layout? Such a hard-copy reference of the layout (a print and online Drupal publication) would make the XML visible to those persons writing/editing content but who are not using InDesign or XML viewing/editing programs. And this would improve workflow considerably. TIA

    Its the nextSibling of nxBook or, you may want to do it via
    an array:
    var xRootNode:XMLNode =xmlData.firstChild ;
    var xnBooks:XMLNode =xRootNode.childNodes;
    for (var j=0;j<xnBooks.length;j++) {
    var attrib:Object =xnBooks[j].attributes
    for (var sattrib:String in attrib ) {
    trace(attrib[sattrib]+ " " + sattrib);

  • How special characters can be used in xml element TAG.

    Hi,
    In my project data is fetched from the database and stored in the xml file. Data contains European characters as well. When I tried with UTF-8 it was giving error but when I changed the encoding to ISO-8859-1, XML generated.
    Well now I am stuck with a problem and as I don�t know much about XML, I am trying to get some knowledge from you.
    I have xml tag like: <Name&>Rohit</Name><employee#>78023</employee>.
    I am getting the error message �top level element must be defined.� This is because special characters are in TAG. But it doesn�t give error if I use special characters/European char in value( like Rohit*).
    I don�t know much about CDATA. Any help from your end will be greatly appreciated.Can this problem resolved if i use java function outformat.CDataElements(String[]) and pass the elements name.
    Thanks!!
    Regards,
    Rohit Dutt

    Client: I want this element name.
    You: The XML recommendation doesn't allow you to have that element name. If you make documents with that element name then no XML software will be able to read them. It just isn't going to work. Insisting on that would just be stupid and pointless. (Okay, you don't say that last sentence that way to your client but that's how it is. Explain it more nicely than that.)

  • XML Elements Ordering in Generated XML Output

    I have a requirement where I need the xml element tags to appear in the generated xml output in the same order as in data template definition but in my case this is not happening. I have one master group - Customer and two subgroups - BillingAddress and ShipToAddress. The subgroups appear below some master elements eg. Contact but above other master elements eg. Telephone . However when the xml output is finally generated all the Master Elements appear first followed by the subgroup elements. Does anyone know how I can rectify this?
    See below:
    my data template structure is as follows:
    - <group name="Customer" dataType="varchar2" source="Q_MASTER_FILE_CUST">
    <element name="CustomerID" datatype="varchar2" value="CUSTOMER_NUM" />
    <element name="CustomerTaxID" datatype="varchar2" value="TAXPAYER_ID" />
    <element name="CompanyName" datatype="varchar2" value="COMPANY_NAME1" />
    <element name="Contact" datatype="varchar2" value="CONTACT_NAME" />
    - <group name="BillingAddress" dataType="varchar2" source="Q_MF_CUST_BILLTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM1" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME1" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE1" />
    <element name="City" datatype="varchar2" value="CITY1" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE1" />
    <element name="Region" datatype="varchar2" value="COUNTY1" />
    <element name="Country" datatype="varchar2" value="COUNTRY1" />
    </group>
    - <group name="ShipToAddress" dataType="varchar2" source="Q_MF_CUST_SHIPTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM2" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME2" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE2" />
    <element name="City" datatype="varchar2" value="CITY2" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE2" />
    <element name="Region" datatype="varchar2" value="COUNTY2" />
    <element name="Country" datatype="varchar2" value="COUNTRY2" />
    </group>
    <element name="Telephone" datatype="varchar2" value="PHONE_NUMBER" />
    <element name="Fax" datatype="varchar2" value="FAX1" />
    <element name="Email" datatype="varchar2" value="EMAIL_ADDRESS" />
    <element name="WebSite" datatype="varchar2" value="URL" />
    </group>
    </group>
    My XML Output is as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    </Customer>
    It should be as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    </Customer>
    is anyone able to advise?
    Rani

    If you know the changes necessary then you could write an XSL transformation to do them. But a generalized piece of code that examined an XML document and a schema, then produced a corrected document, would be quite difficult to write.

  • XML tag markers moved: Find and Replace causing problem in xml elements

    Hi All,
    I am doing find and replace using GREP. While using the expression like $1, $2 (Found Items) in the change to field it changes the placement of tag marker. If the found item is a part of two of more xml elements, I am getting a serious problem while replacing it. (ie. The xml tag markers are moved.)
    See the screen shot below, then you may get better idea. And help me to overcome this issue.
    This is just an example to show you what i'm trying to say, there are so many cases like this.
    Original text/ Before doing find replace
    After replacing
    Green4ever

    Hi Peter and John,
    but it seems to me that the example is looking for any space that
    follows a semi-colon and has two word characters following it, and
    repalce that with an em space. I think you could do the same using look
    behind and look ahead and not need to replace the found text.
    Yes you are right about the look behind and look ahead. I'd like to show some more examples to show what the actual problem is,
    Original/Before Replacing,
    (Consider there is another case here, instead of em-space some times normal word space will also be there)
    Using the Grep:
    Find What---------> ^(\d+\.(?:\d+)?)~m
    Change To------------->$1\t
    After Replace:
    Did I make any sense? Eventhough this will not make any changes in the layout, my requirement is to insert the tab out-side the tag marker not indise.
    Green4ever

  • Remove XML tags from XML element in Oracle

    Hi,
    I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
    select
    TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
    ('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
    from dual
    **************Out put*************
    MyText Data goes here ;Data agian

    One way is to use xquery:
    SQL> with t as
    select xmltype('<Concatcolumn>
                          <ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
       ) xml from dual
    select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
    XML                                                              
    MyText Data goes here ;Data agian                                
    1 row selected.

  • Problem changing XML element in Adapter Module

    Hey!
    I am developing an adapter module to transform a coded password back to clear text. I have access to the XML element where the password is and I get to transform it, but I have 2 problems as also stated in the code:
    1) I cannot set the new value back to the node. I try with
    firstNode.getFirstChild().setNodeValue(decodedPwd);
    but this does not seem to work. How can I achieve this?
    2) Between the first issue and the code
    msg.setDocument(xmlpayload);
    I am not sure how to get my new values for the node back in the XMLPayload. How can I achieve this?
    Here is the code:
    msg = (Message) inputModuleData.getPrincipalData();
              XMLPayload xmlpayload = msg.getDocument();
              factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document document = builder.parse((InputStream)xmlpayload.getInputStream());
              password = (Element)document.getElementsByTagName("ns1:passord").item(0);
              firstNode = password.getFirstChild();                    
              pwd = firstNode.getNodeValue();
              if(pwd != null){
                   decodedPwd = Decoder.decodeString(pwd);
    // THIS FAILS!
              firstNode.getFirstChild().setNodeValue(decodedPwd);
    //HOW TO SET NEW NODE VALUE TO XMLPAYLOAD HERE?
              msg.setDocument(xmlpayload);
              inputModuleData.setPrincipalData(msg);
                   return inputModuleData;          
    Help is much appreciated!
    Thanks!
    regards Ole

    Hey!
    The problem was solved. The code snipped I found was:
                   DOMSource DOMSource = new DOMSource(document);
                   ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
                   Result dest = new StreamResult(myBytes);
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer serializer = tf.newTransformer();
                   serializer.transform(DOMSource, dest);
                   byte[] docContent = myBytes.toByteArray();
                   xmlpayload.setContent(docContent);
                   msg.getDocument().setContent(xmlpayload.getContent());               
    Ole
    Edited by: Ole Mugaas on Mar 27, 2008 8:43 PM

  • Getting Tag and value from the selected Xml element value

    Hi All,
    I have an xml file which i import to the Indesign CS3 .From the structure view , i drag and drop the root node on to the page. Now i select an xml value from the page. Now i need to get the element tag and value from the selected value.
    For example
    File Name : sample1.xml
    <Root>
    <employeeName> A</employeeName>
    <employeeEmail>[email protected]</employeeEmail>
    </Root>
    Now i import this sample.xml in my indesign CS3 and from the structure view i drag the Root  tag and drop it on the page.Now the values of the element tag are displayed.
    Now i select "[email protected]" from the page and i have a menu "Get Selected XML" on clicking which  i should get element tag with value.(i.e <employeeEmail>[email protected]</employeeEmail>)
    How to go about it.?
    Thanks
    Sakthi

    Hi Steve,
    If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
    Jared

  • Create XML element without closing tag using Visual C++

    I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)
    <tag id="1234">
    </tag>
    but is there a way in Visual C++ to produce xml element like this
    <tag id="1234"/>
    i.e. without closing tag?

    Hi adamay,
    Please refer to this thread.
    http://stackoverflow.com/questions/8182245/create-xml-element-without-closing-tag-using-xslt
    I think you could try the way of write your own class derived from XmlWriter.
    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.

  • Rename or Tag Element for particular Xml Element.

    hi,
    How to rename or Tag Element for particular Xml Element using Java Script.
    eg)label to labels
    Thanks in advance
    Smile

    Hi,
           Thanks a lot Jeff...
            I'm doing a huge program with lot of tasks. While doing that,my mind didn't strike to check if the tag is not already exist, then only to create new tag...  Thanks for all of the indesigner experts for their replies...
    I used the following codes with ur idea.
                        var renamewith = textbox1.text;
                        try
                            alert(app.activeDocument.xmlTags.item(renamewith).name);
                            if(app.activeDocument.xmlTags.item(renamewith).name)
                               var testTag = app.activeDocument.xmlTags.item(renamewith);
                        catch(e)
                            var testTag = app.activeDocument.xmlTags.add({name: renamewith});
    With Regards,
    Vel.

  • Problem with XML element creation

    hello,
    i have a problem creating an XML element using XMLForest
    and XMLConcat in Oracle 9.2.0.3 release.
    This problem there wasn't when we had the Oracle 9.2.0.2
    release.
    If i make this statement:
    SELECT XMLELEMENT( "message",
    XMLATTRIBUTES( 1321324 AS IDSEQ,
    'fff' AS CDMS,
    'fff' AS TPMS,
    SYSDATE AS TIME,
    342134 AS REFID),
    XMLCONCAT( XMLELEMENT("header",
    XMLFOREST( 'ttt' AS TXID,
    'rrr' AS RXID,
    'QQQ' AS QUEUENAME,
    XMLFOREST( 123456789 AS COD_COM,
    111 AS ID_CAT,
    'www' AS ID_ITM,
    1123 AS PR_KEY,
    'ST' AS STATUS) AS REFOBJ)),
    xmltype('<body>gfgfg</body>') )).getstringval() FROM dual;
    i got this XML document:
    <message IDSEQ="1321324" CDMS="fff" TPMS="fff" TIME="28-MAR-03" REFID="342134">
    <body>gfgfg</body>
    </message>
    D>rrr</RXID>
    <QUEUENAME>QQQ</QUEUENAME>
    <REFOBJ>
    <COD_COM>123456789</COD_COM>
    <ID_CAT>111</ID_CAT>
    <ID_ITM>www</ID_ITM>
    <PR_KEY>1123</PR_KEY>
    <STATUS>ST</STATUS>
    </REFOBJ>
    </header>
    instead of this:
    <message IDSEQ="1321324" CDMS="fff" TPMS="fff" TIME="28-MAR-03" REFID="342134">
    <header>
    <TXID>ttt</TXID>
    <RXID>rrr</RXID>
    <QUEUENAME>QQQ</QUEUENAME>
    <REFOBJ>
    <COD_COM>123456789</COD_COM>
    <ID_CAT>111</ID_CAT>
    <ID_ITM>www</ID_ITM>
    <PR_KEY>1123</PR_KEY>
    <STATUS>ST</STATUS>
    </REFOBJ>
    </header>
    <body>gfgfg</body>
    </message>
    any idea?
    this happens only after we had installed the patch 9.2.0.3
    thanks in advance
    Mc

    As Jim Stated the problem is related to using XMLCONCAT and a combination of SQL/XML non SQL/XML operators. In this example XMLCONCAT is not required. XMLElement allows multiple XMLType children to be included in the Element, as the attached SQL shows...
    Christian please note that Oracle strongly recommend the use of the SQL/XML operators over ways of generating XML from SQL queries. All future development efforts will be focused on optimizing and improving this technology, rather that older, legacy approaches.
    SQL> SELECT XMLELEMENT
    2 ( "message",
    3 XMLATTRIBUTES
    4 (
    5 1321324 AS IDSEQ,'fff' AS CDMS,'fff' AS TPMS,SYSDATE AS TIME,342134 AS REFID
    6 ),
    7 XMLELEMENT
    8 (
    9 "header",
    10 XMLFOREST
    11 (
    12 'ttt' AS TXID,
    13 'rrr' AS RXID,
    14 'QQQ' AS QUEUENAME,
    15 XMLFOREST
    16 (
    17 123456789 AS COD_COM,
    18 111 AS ID_CAT,
    19 'www' AS ID_ITM,
    20 1123 AS PR_KEY,
    21 'ST' AS STATUS
    22 ) AS REFOBJ
    23 )
    24 ),
    25 xmltype
    26 (
    27 '<body>gfgfg</body>'
    28 )
    29 ).getstringval()
    30 FROM dual;
    XMLELEMENT("MESSAGE",XMLATTRIBUTES(1321324ASIDSEQ,'FFF'ASCDMS,'FFF'ASTPMS,SYSDAT
    <message IDSEQ="1321324" CDMS="fff" TPMS="fff" TIME="31-MAR-03" REFID="342134"><
    header><TXID>ttt</TXID><RXID>rrr</RXID><QUEUENAME>QQQ</QUEUENAME><REFOBJ><COD_CO
    M>123456789</COD_COM><ID_CAT>111</ID_CAT><ID_ITM>www</ID_ITM><PR_KEY>1123</PR_KE
    Y><STATUS>ST</STATUS></REFOBJ></header><body>gfgfg</body>
    </message>
    SQL> select xmlelement("a", xmlelement("empno", empno), xmltype('<b>1</b>')) from emp;
    XMLELEMENT("A",XMLELEMENT("EMPNO",EMPNO),XMLTYPE('<B>1</B>'))
    <a><empno>7369</empno><b>1</b>
    </a>
    <a><empno>7499</empno><b>1</b>
    </a>
    <a><empno>7521</empno><b>1</b>
    </a>
    <a><empno>7566</empno><b>1</b>
    </a>
    XMLELEMENT("A",XMLELEMENT("EMPNO",EMPNO),XMLTYPE('<B>1</B>'))
    <a><empno>7654</empno><b>1</b>
    </a>
    <a><empno>7698</empno><b>1</b>
    </a>
    <a><empno>7782</empno><b>1</b>
    </a>
    <a><empno>7788</empno><b>1</b>
    XMLELEMENT("A",XMLELEMENT("EMPNO",EMPNO),XMLTYPE('<B>1</B>'))
    </a>
    <a><empno>7839</empno><b>1</b>
    </a>
    <a><empno>7844</empno><b>1</b>
    </a>
    <a><empno>7876</empno><b>1</b>
    </a>
    XMLELEMENT("A",XMLELEMENT("EMPNO",EMPNO),XMLTYPE('<B>1</B>'))
    <a><empno>7900</empno><b>1</b>
    </a>
    <a><empno>7902</empno><b>1</b>
    </a>
    <a><empno>7934</empno><b>1</b>
    </a>
    14 rows selected.

Maybe you are looking for