XMLDocument and blank XML tag parse issue

var xmlDoc:XMLDocument = new XMLDocument();
                xmlDoc.ignoreWhite = false;
                xmlDoc.parseXML("<Test> </Test>");
                var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
                var processObj:Object = decoder.decodeXML(xmlDoc);
               trace( processObj.Test  );
Result is comming as 0 instead of a blank space between the tags(<Test> </Test>).

Hi,
Here are two possible solutions :
xmlelement("EXCEPTIONS",
  xmlforest(
    xmlforest(
      v1.exception_code as "EXCEPTION_CODE"
    , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
    ) as "EXCEPTION"
)or,
xmlelement("EXCEPTIONS",
  case when v1.exception_code is not null
         or v1.exception_long_desc is not null
    then xmlelement("EXCEPTION",
           xmlforest(
             v1.exception_code as "EXCEPTION_CODE"
           , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
  end
)

Similar Messages

  • XML Document parsing issue

    Hello I am doing some SOAP XML stuff and I am having an issue that hopefully I can get some help with.
    Is XML like this valid to do in a SOAP message?
    <prompt>1 &_lt_; 0? <prompt>It's suppose to represent "1 < 0?"
    * the forum formatter seems to eat up my encoded text and transofrms it into acutal "<" so I am placing underscores "_" everywhere to keep the text. so above is actually without underscores
    From what I've read I think it is. I have text like this transported as part of the overall SOAP message to my client from the server.
    In my code I do:
    // Create an instance of the DocumentBuilderFactory
    DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
    // Get the DocumentBuilder from the factory
    DocumentBuilder builder = documentFactory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);
    ...inputStream is an InputStream (specifically ByteArrayInputStream) containing the XML.
    The issue I am having is that wherever I have an '&' (such as "&_lt_;" or "&_gt_;" or "&" etc...) the parsing seems to get cut off and the rest of the string doesn't seem to get parsed. So the above string "1 &_lt_; 0?" ends up being "1 ".
    Also is there an easy way to get back or rebuild the XML into a string from a Document object? I would really like to do that right after I do the parse method and see if the XML data that the Document object has is the same as what's in the inputStream (which is "1 &_lt_; 0?").
    Any input you can provide is much appreciated. Thanks,
    Latem

    Hello I am doing some SOAP XML stuff and I am having an issue that hopefully I can get some help with.
    Is XML like this valid to do in a SOAP message?
    <prompt>1 &_lt_; 0? <prompt>It's suppose to represent "1 < 0?"
    * the forum formatter seems to eat up my encoded text and transofrms it into acutal "<" so I am placing underscores "_" everywhere to keep the text. so above is actually without underscores
    From what I've read I think it is. I have text like this transported as part of the overall SOAP message to my client from the server.
    In my code I do:
    // Create an instance of the DocumentBuilderFactory
    DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
    // Get the DocumentBuilder from the factory
    DocumentBuilder builder = documentFactory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);
    ...inputStream is an InputStream (specifically ByteArrayInputStream) containing the XML.
    The issue I am having is that wherever I have an '&' (such as "&_lt_;" or "&_gt_;" or "&" etc...) the parsing seems to get cut off and the rest of the string doesn't seem to get parsed. So the above string "1 &_lt_; 0?" ends up being "1 ".
    Also is there an easy way to get back or rebuild the XML into a string from a Document object? I would really like to do that right after I do the parse method and see if the XML data that the Document object has is the same as what's in the inputStream (which is "1 &_lt_; 0?").
    Any input you can provide is much appreciated. Thanks,
    Latem

  • How can i find and replace xml tags?

    Hi, i am using xml in my workflow and want to be able to remove certain tags if they contain particular text.
    here is an example of my xml structure…
    <entry>
        <name>DEFAULT</name>
        <tel>DEFAULT</tel>
        <address>DEFAULT</address>
    </entry>
    I am using this initial structure to set the paragraph styles to be followed when the xml data is imported.
    This leaves DEFAULT in place wherever an entry doesn't have any content for that field.
    I want to be able to import my XML then run a script that removes any tags that include DEFAULT, - I need the entire xml tag to be removed not just the text, if i do a normal find and replace it will only remove the text not the tags which is causing problems with styling. I also want to remove the end of para/return (^p) that i've placed at the end of the line. So it would be the same as opening up story editor and removing the content + tags + hard return in there, but i want to automate the process…
    So i think this is what i need to search for in each case
    "<name>DEFAULT</name>^p"
    and i want to replace it with nothing ""
    Can this be done through scripting (ideally javascript)?
    I have a little knowledge of javascript but am not sure how to search and target that kind of string in indesign...
    using indesign cs5
    many thanks

    Hi,
    Script should do it in two steps:
    1. find all occurences of i.e. ">DEFAULT<"
    2. remove whole paragraph which is a found_text's container.
    For example this way -JS - (a textFrame filled with your text should be selected) :
    var mStory = app.selection[0].parentStory;
    app.findTextPreferences =  null;
    app.findTextPreferences.findWhat = ">DEFAULT<";
    var myF = mStory.findText();
    var count = myF.length;
    while (count--)
         myF[count].paragraphs[0].remove();
    rgds

  • Formating and calculating xml tag value

    I have an xml file that holds xml tag such as <weight>.55 kg</weight>
    I want to have two outputs:
    Output 1) Output to print: 0.55
    Output 2) Output to print 0.8 of the xml tag value (0.55 * 0.8) : 0.44
    I was able to get the Output 1) by using <?format-number:weight;'9G990D00'?>
    However, I can not get the Output2) as expected.
    If I put <?format-number:(weight)*0.8;'9G990D00'?>,
    I get the error message "Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert .55 kg to number."
    Appreciate any help on how to solution for Output2)
    Edited by: user4697912 on Jun 22, 2010 1:23 AM
    Edited by: user4697912 on Jun 22, 2010 1:23 AM

    If that is the case then try using
    <?format-number:( substring-before(WEIGHT,'kg')*0.8);'9G990D00'?>

  • Search for, edit, and delete XML tag (Adobe InDesign Server CS5)

    Hi all,
    I'm working with Indesign Server CS5 and JavaScript, though having some trouble coming up with a solution to a problem...
    I need to build a JS script (called through SOAP) that will enable me to search an InDesign file for a given XML tag.
    Upon finding the XML tag, if the 'action' variable is set to delete, it should delete the tag and its contents.
    If the action is set to edit, it should change the contents of the tag to some user-specified content.
    The primary caveat is that the XML tag is variable, as is the XML structure of the InDesign file.
    Here's what I have in mind, in pseudocode:
    function findXMLTag(tag, action) {
         app.searchForTag(tag);
         if (tagIsFound) {
              if (action == "delete") {
                   tag.delete;
              } else if (action == "edit") {
                   tag.contents = "Updated content";
    Any help would be greatly appreciated!
    Thanks,
    Ben Kay

    'searchForTag' can be implemented as a recursive function.
    Recursion is defined like this: I thought, "I'll just search this forum for 'recursion'." The first post I found was one of my own, suggesting that the poster should search the forum for 'recursion'.
    Here is an example: find the XML Element [<email>]
    And another: Remove xml element using JS[CS3] (read carefully, as the OP got stuck on how to successfully remove an element and continue)
    And one, using XML Rules -- which I'm totally unfamiliar with, but may work for you: Changing Values in XML tags

  • XML file parse issue

    I have a requirement to print <attribute-override> and <column> in a spreadsheet.
    My xml file is as
    <?xml version="1.0" encoding="UTF-8"?>
    <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd">
      <entity class="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetricDetails">
        <table name="FLX_AC_ACCT_CREDIT_MATRIX_DTLS"/>
        <attributes>
          <embedded-id attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetricDetailsKey" name="key">
            <attribute-override name="accountId">
              <column name="ACCOUNT_ID"/>
            </attribute-override>
            <attribute-override name="accountType">
              <column name="ACCOUNT_TYPE"/>
            </attribute-override>
            <attribute-override name="effectiveDate">
              <column name="EFFECTIVE_DATE"/>
            </attribute-override>
            <attribute-override name="matrixIdvalue">
              <column name="MATRIX_ID_VALUE"/>
            </attribute-override>
            <attribute-override name="classification">
              <column name="Classification"/>
            </attribute-override>
          </embedded-id>
          <embedded attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.CreditMetric" name="creditMetric">
            <attribute-override name="metricType">
              <column name="METRIC_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="metricValue">
              <column name="METRIC_VALUE" unique="false"/>
            </attribute-override>
          </embedded>
          <embedded attribute-type="com.ofss.fc.domain.account.entity.accountcreditmatrix.RiskScore" name="riskScore">
            <attribute-override name="scoreType">
              <column name="SCORE_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="otherScoreType">
              <column name="OTHER_SCORE_TYPE" unique="false"/>
            </attribute-override>
            <attribute-override name="scoreCardExternalReferenceNo">
              <column name="SCORE_EXTR_REF_NO" unique="false"/>
            </attribute-override>
            <attribute-override name="ratingModel">
              <column name="RATING_MODEL" unique="false"/>
            </attribute-override>
            <attribute-override name="ratingStatus">
              <column name="RATING_STATUS" unique="false"/>
            </attribute-override>
            <attribute-override name="riskGrade">
              <column name="RISK_GRADE" unique="false"/>
            </attribute-override>
            <attribute-override name="scoreCardIndex">
              <column name="SCORE_CARD_INDEX" unique="false"/>
            </attribute-override>
            <attribute-override name="score">
              <column name="SCORE" unique="false"/>
            </attribute-override>
          </embedded>
        </attributes>
      </entity>
    </entity-mappings>
    I have managed to write the code as
    package xmlexcel;
    import org.apache.poi.hssf.usermodel.*;
    import java.util.ArrayList;
    import java.awt.List;
    import java.io.*;
    import java.util.ArrayList;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class XMLconvertExcel {
      private static File xmlDocument;
        private static NodeList e;
        int a;
      public void generateExcel(File xmlDocument) {
      try {
      HSSFWorkbook wb = new HSSFWorkbook();
      HSSFSheet spreadSheet = wb.createSheet("spreadSheet");
      spreadSheet.setColumnWidth((short)0,(short) (256*25));
      spreadSheet.setColumnWidth((short)1,(short) (256*25));
      spreadSheet.setColumnWidth((short)2,(short) (256*25));
      spreadSheet.setColumnWidth((short)3,(short) (256*25));
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document document = builder.parse(xmlDocument);
      NodeList nList = document.getElementsByTagName("attributes");
      document.getDocumentElement().normalize();
      //a=nodelist.getLength();
      //e = printStackTrace();
      //System.out.println("I am here " +e);
             System.out.println("Root element :" + document.getDocumentElement().getNodeName() + " nlist length  " +nList.getLength());
             System.out.println("Node Type :" + document.getDocumentElement().getNodeType());
      HSSFRow row = spreadSheet.createRow(0);
      HSSFCell cell = row.createCell((short)0);
      cell.setCellValue("Entity");
      cell = row.createCell((short)1);
      cell.setCellValue("Table");
      cell = row.createCell((short)2);
      cell.setCellValue("Attribute");
      cell = row.createCell((short)3);
      cell.setCellValue("Column");
      HSSFRow row1 = spreadSheet.createRow(1);
      HSSFRow row2 = spreadSheet.createRow(2);
      HSSFRow row3 = spreadSheet.createRow(3);
      for (int i = 0; i < nList.getLength(); i++) {
      Node nNode = nList.item(i);
                 System.out.println("\nCurrent Element :"    + nNode.getNodeName());
                 switch {
      case 0:
      //cell = row1.createCell((short)0);
      //cell.setCellValue("Attribute");
      //trying from http://architects.dzone.com/articles/parsing-xml-using-dom-sax-and
      cell = row1.createCell((short) 2);
                    cell.setCellValue(((Element) (nList.item(0)))
                       .getElementsByTagName("attribute-override").item(0)
                       .getFirstChild().getNodeValue());
      break;
      case 1:
      //cell = row1.createCell((short)1);
      //cell.setCellValue("Table");
      cell = row1.createCell((short) 3);
      cell.setCellValue(((Element) (nList.item(0)))
      .getElementsByTagName("column").item(0)
      .getFirstChild().getNodeValue());
      break;
      case 2:
      cell = row1.createCell((short)2);
      cell.setCellValue("Attribute");
      cell = row1.createCell((short) 2);
      cell.setCellValue(((Element) (nodelist.item(2)))
      .getElementsByTagName("attribute-override").item(0)
      .getFirstChild().getNodeValue());
      cell = row1.createCell((short)3);
      cell.setCellValue("Column");
      cell = row1.createCell((short) 3);
      cell.setCellValue(((Element) (nodelist.item(3)))
      .getElementsByTagName("column").item(0)
      .getFirstChild().getNodeValue());
      break;
      default:
      break;
      //wb.write(arg1.getOutputPayload().getOutputStream());
      //Outputting to Excel spreadsheet
      FileOutputStream output = new FileOutputStream(new File("C:\\java_training\\com\\XMLtoExcel\\ormaccount.xls"));
             wb.write(output);
             output.flush();
             output.close();
      } catch (IOException e) {
      System.out.println("IOException " + e.getMessage());
      } catch (ParserConfigurationException e) {
      System.out.println("ParserConfigurationException " +e.getMessage());
      }catch (SAXException e) {
      System.out.println("SAXException " +e.getMessage());
      private String printStackTrace() {
      // TODO Auto-generated method stub
      return null;
      * @param args
      public static void main(String[] args) {
      File xmlDocument = new File("C:\\java_training\\com\\XMLtoExcel\\AccountCreditMatrixDetails.orm.xml");
      XMLconvertExcel excel = new XMLconvertExcel();
      excel.generateExcel(xmlDocument);
    Both the tags are not getting printed in separate columns.
    I have looked at
    http://www.javaworld.com/article/2076189/enterprise-java/book-excerpt--converting-xml-to-spreadsheet--and-vice-versa.html
    http://scn.sap.com/thread/3224533
    http://www.tutorialspoint.com/java_xml/java_dom_parse_document.htm
    The above URL shows example of simple xml.
    Please can I get assistance.

    I too received this error as I tried to run my first Windows 8.1 deployment. Per another post I commented out this line
    <IEWelcomeMsg>false</IEWelcomeMsg>
    from the IE section of the unattend.xml. I was then able to run my deployment. I do not see this line in your posting though.
    I referenced this link even though it was for Windows 7.
    http://social.technet.microsoft.com/Forums/en-US/c41a2b69-a591-4cd3-86ab-6a0f8a73b858/getting-windows-could-not-parse-or-process-the-unattend-answer-file-for-pass-specialize-with?forum=mdt
    Hope this helps someone.
    JayTheTech
    To clarify, I edited the unattend.xml file from from Deployment Share, not C:\Windows\Panther.
    DS\control\task sequence ID\unattend.xml
    JayTheTech

  • RFC to XML-RFC Parsing issue in RFC Adapter as Sender

    Hi all,
    I tried to use RFC adapter as a sender. The scenario I am trying to achieve is R3 -> RFC Adapter Sender --> BPM --> RFC Adapter Receiver --> SAP Auto-ID system.
    The reason to use two RFC adapter and BPM is to log the request message if the RFC call fails. Everything works as expected, except the RFC Adapter Sender.
    The RFC I am calling has an input table. The input data I use works fine if I call it via SE37 or remotely from another SAP system. However, if I call it via RFC adapter, when XI parses the data into RFC-XML format, the input data is all messed up.
    DATA: BEGIN OF ID_STR,
            ID_VERSION(8)       TYPE C,
            ID(96)              TYPE C,
            ELEMENT_NAME(50)    TYPE C,
            ELEMENT_VALUE(128)  TYPE C,
          END OF ID_STR.
    DATA: it_id LIKE TABLE OF ID_STR,
          ls_id LIKE ID_STR.
    ls_id-ID_VERSION = 'EPC_1.30'.
    ls_id-ID = '30340242206DC3C00000000A'.
    ls_id-element_name = 'BATCH_ID'.
    ls_id-element_value = 'BATCH001'.
    APPEND ls_id TO it_id.
    CALL FUNCTION '/AIN/UI_MOBILE_MSG_SEND'
      IN BACKGROUND TASK
      DESTINATION  'RFC_UPDATEAII'
      EXPORTING
        IV_BUSINESS_PROCESS       = '09'
        IV_COMMAND                = 'DO'
        IV_ACTION_TYPE            = 'APL2'
        IV_PRT_ID                 = '31140242200000000F000000'
        IV_DEVGRP_EXTID           = 'MOBILE'
      TABLES
        IT_ID                     = it_id
      commit work.
    And the parsed RFC-XML message is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <rfc:_-AIN_-UI_MOBILE_MSG_SEND
    xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    <IV_ACTION_TYPE>APL2</IV_ACTION_TYPE>
    <IV_BTD_EXTID />
    <IV_BTD_TYPE />
    <IV_BUSINESS_PROCESS>09</IV_BUSINESS_PROCESS>
    <IV_COMMAND>DO</IV_COMMAND>
    <IV_DEVGRP_EXTID>MOBILE</IV_DEVGRP_EXTID>
    <IV_LOC_EXTID />
    <IV_LOC_TYPE />
    <IV_PRT_ID>31140242200000000F000000</IV_PRT_ID>
    <IV_PRT_ID_VERSION />
    <IV_REASON_CODE />
    <IV_UNAME/>
    <ET_RETURN />
    <IT_ID>
    <item>
    <ID_VERSION>EPC_1.30</ID_VERSION>
    <ID>206DC3C00000000A BATCH_ID</ID>
    <ELEMENT_NAME />
    <ELEMENT_VALUE />
    </item>
    </IT_ID>
    </rfc:_-AIN_-UI_MOBILE_MSG_SEND>
    You can see the data in the table is all wrong, it should be:
    <IT_ID>
    <item>
    <ID_VERSION>EPC_1.30</ID_VERSION>
    <ID>30340242206DC3C00000000A</ID>
    <ELEMENT_NAME>BATCH_ID</ELEMENT_NAME>
    <ELEMENT_VALUE>BATCH001</ELEMENT_VALUE>
    </item>
    </IT_ID>
    The calling system is a 4.6C non-unicode system, and the destination system is a unicode system (this does not matter since the first part of the integration is between R3 and XI). There is no config found on R3 side to specify non-unicode because it is a rather old system. In XI RFC Adapter config, I checked non-unicode checkbox (I also tested it with this unchecked, but still the same issue).
    Have any of you seen this problem and how you resolve it?
    Thanks a lot for your help!
    Regards,
    Hart

    Hi Hart
    long time no seen - hope you remember me
    >The reason to use two RFC adapter and BPM is to log the request message if the RFC call fails
    there is an easy way (guess max 3-4 hours) to solve all of your issues
    and get rid of a BPM
    use IDOC - XI - ABAP Proxy
    then you will have IDOC and ABAP Proxy that always log the message on both ends (and you can restart ABAP proxies easily in AII - and every AII supports ABAP proxies) + you get rid of a BPM as it's not necessary as far as I understand (as it's asyn communication right?)
    maybe you can go this way and IDOCs always work...
    good luck,
    Regards,
    Michal Krawczyk
    http://mypigenie.com XI/PI FAQ

  • Select count(*) and blank element tags

    Is there a way other than column aliases to produce and return an element tag for the following xsql query.
    <xsql:query
    connection="{@cxn}"
    xmlns:xsql="urn:oracle-xsql">
    select count(*) from emp
    </xsql:query>
    Some databases such as SQL Server via a JDBC driver will return a blank column name, thus you'll have an invalid XML document, however SQL Server allows one to use column aliases, such as select count(*) as "count" from emp.
    However some databases such as Progress via a JDBC-ODBC bridge and ODBC driver does NOT allow column aliases. Thus I'll always get the following response:
    <ERROR>oracle.xml.sql.OracleXMLSQLException: String index out of range: </ERROR>
    Question. Can I substitute an element tag when I encounter a blank column name using an action handler? Any ideas? Sample code?
    Steve.

    Please have the data structure as below:
    <datastructure>
    <GROUP name="G_1" source="Q_TEMP">
    <element value="DEPTNO" name="DEPTNO" />
    <element value="DNAME" name="DNAME" />
    <element value="LOC" name="LOC" />
    <GROUP name="G_2" source="Q_TEMP1">
    <element value="ENAME" name="ENAME" />
    <element value="SAL" name="SAL" />
    *</GROUP>*
    *<element value="G_2.ENAME" name="TOTL_DETAILS" dataType="number" function="COUNT()" />*
    *<element value="G_2.SAL" name="TOTL_SAL" function="SUM()"/>*
    *</GROUP>*
    </datastructure>
    Aggregate functions to be placed at the level you require it. Here you need at G_1, so place it there.

  • Change XML Tags Parse Date

    I need to change tags or elements in XML that is exported from Access to to put data into a calendar.
    This:
    <Courses>
    <Date>3/04/2009</Date>
    <Title>Ocean Star Museum FENG 1001</Title>
    <Description>Galveston Offshore Rig Museum</Description>
    </Courses>
    To this:
    <events>
        <event>
            <month>3</month>
            <day>4</day>
            <year>2009</year>
            <text>Ocean Star Museum FENG 1001</text>
            <popuplink/>
            <style/>
            <tooltip/>
            <script/>
        </event>
    I know I need to use XSLT, but can I parse the date? SHould I put Day Month and Year separate in the database? Can it be parsed?

    I still dont know how to get the query to output what I want. Should I create all the columns necessary for the calendar?
    I need these XML elements:
    Month
    Day
    Year
    Text
    Popuplink
    Style
    Tooltip
    Script
    Filter
    These are the items in the sample xml that goes with the calendar. Should I make a table in Access that has these columns? I currently have the database working, but with a different configuration. I assume I may need to add a few columns such as "Popuplink" and others. How can I get the Month Day and Year field in a Query if I don't have a column for these. It seems the query relates to a column in the database.
    I'm currently trying to use the DatePart function in the Query Builder. I'm new to backend stuff.
    jessicauresti.net

  • How to generate blank xml tag when encounter null elements in it

    Hi Gurus,
    Iam facing one issue in generating the blank tag, here is my file which I am generating right now
    <HEADER>
        <MINISTRY_CODE>RPO</MINISTRY_CODE>
        <DEPARTMENT_CODE>000</DEPARTMENT_CODE>
        <ORDER_CODE>RPO000EPO11001002</ORDER_CODE>
        <EXTERNAL_SYSTEM_CODE>E</EXTERNAL_SYSTEM_CODE>
        <AMENDMENT_NUMBER>0</AMENDMENT_NUMBER>
        <VARIATION_NUMBER>0</VARIATION_NUMBER>
        <EXCEPTIONS>
          <EXCEPTION>
            <EXCEPTION_CODE>PO016</EXCEPTION_CODE>
            <EXCEPTION_LONG_DESC>PO cannot be created/amended successfully</EXCEPTION_LONG_DESC>
          </EXCEPTION>
        </EXCEPTIONS>
      </HEADER>
      <ITEMS>
        <ITEM>
          <LINE_NUMBER>1</LINE_NUMBER>
          <EXCEPTIONS>
            <EXCEPTION>
              <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
              <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
            </EXCEPTION>
          </EXCEPTIONS>
          <LOCATIONS>
            <LOCATION>
              <LINE_NUMBER>1</LINE_NUMBER>
              <EXCEPTIONS>
                <EXCEPTION>
                  <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                  <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                </EXCEPTION>
              </EXCEPTIONS>
              <DISTRIBUTIONS>
                <DISTRIBUTION>
                  <LINE_NUMBER>1</LINE_NUMBER>
                  <EXCEPTIONS>
                    <EXCEPTION>
                      <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                      <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                    </EXCEPTION>
                  </EXCEPTIONS>
                </DISTRIBUTION>
              </DISTRIBUTIONS>
            </LOCATION>
          </LOCATIONS>
        </ITEM>
      </ITEMS>
    </GEBIZ_ORDER_ACK>current I am generating EXCEPTION tag even if it is null like
    <EXCEPTIONS>
    <EXCEPTION>
    <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </EXCEPTION>
    </EXCEPTIONS>
    but my requirement is not generate them when exception code is null and only generate like
    <EXCEPTIONS/>
    this is sql i am using to generate the above said code let me know how can i control that
                       SELECT xmlserialize(document
                                  xmlelement("GEBIZ_ORDER_ACK"
                                  , xmlagg(
                                      xmlconcat(hdr, dtls)
                                  as clob indent size = 2
                       --  INTO lv_out
                         FROM (
                               SELECT xmlelement("HEADER"
                                           , xmlelement("MINISTRY_CODE", poh.ministry_code)
                                           , xmlelement("EXCEPTIONS"
                                                 , xmlelement("EXCEPTION"
                                                             , xmlelement("EXCEPTION_CODE"   --,NVL(poh.exception_code,'NULL')
                                                             , xmlattributes(
                                                               NVL2(poh.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                             , NVL2(poh.exception_code,null,'true') as "xsi:nil"
                                                             ,poh.exception_code)
                                                             , xmlelement("EXCEPTION_LONG_DESC"
                                                             , xmlattributes(
                                                               NVL2(poh.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                             , NVL2(poh.exception_long_desc,null,'true') as "xsi:nil"
                                                             ,poh.exception_long_desc)
                                           ) hdr
                                     , xmlelement("ITEMS"
                                     , xmlagg(
                                              xmlelement("ITEM"
                                               ,xmlelement("LINE_NUMBER", v1.line_no)
                                               ,xmlelement("EXCEPTIONS"
                                                        , xmlelement("EXCEPTION"
                                                                    , xmlelement("EXCEPTION_CODE"    --,NVL(v1.exception_code,'NULL')
                                                                    , xmlattributes(
                                                                      NVL2(v1.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                                    , NVL2(v1.exception_code,null,'true') as "xsi:nil"
                                                                    , v1.exception_code)
                                                                    , xmlelement("EXCEPTION_LONG_DESC"
                                                                    , xmlattributes(
                                                                      NVL2(v1.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                                    , NVL2(v1.exception_long_desc,null,'true') as "xsi:nil"
                                                                    ,v1.exception_long_desc)
                                               ,xmlelement("LOCATIONS"
                                               ,( SELECT xmlagg(
                                                          xmlelement("LOCATION"
                                                        , xmlelement("LINE_NUMBER",v2.location_line_no)
                                                        , xmlelement("EXCEPTIONS"
                                                        , xmlelement("EXCEPTION"
                                                        , xmlelement("EXCEPTION_CODE"   --,NVL(v2.exception_code,'NULL')
                                                        , xmlattributes(
                                                          NVL2(v2.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                        , NVL2(v2.exception_code,null,'true') as "xsi:nil"
                                                        , v2.exception_code)
                                                        , xmlelement("EXCEPTION_LONG_DESC"
                                                        , xmlattributes(
                                                          NVL2(v2.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                        , NVL2(v2.exception_long_desc,null,'true') as "xsi:nil"
                                                        ,v2.exception_long_desc)
                                               ,xmlelement("DISTRIBUTIONS"
                                               ,(SELECT xmlagg
                                                 (       xmlelement("DISTRIBUTION"
                                                         ,xmlelement("LINE_NUMBER", v3.distribution_line_no)
                                                         ,xmlelement("EXCEPTIONS"
                                                         , xmlelement("EXCEPTION"
                                                         , xmlelement("EXCEPTION_CODE"--,NVL(v3.exception_code,'NULL')
                                                         , xmlattributes(
                                                           NVL2(v3.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                         , NVL2(v3.exception_code,null,'true') as "xsi:nil"
                                                         ,v3.exception_code)
                                                         , xmlelement("EXCEPTION_LONG_DESC"
                                                         , xmlattributes(
                                                           NVL2(v3.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                         , NVL2(v3.exception_long_desc,null,'true') as "xsi:nil"
                                                        ,v3.exception_long_desc)
                                                          ) ORDER BY v3.distribution_line_no
                                                       ) FROM xgbz_fin_stage_ack_pot_v@dev_1157.RP.EDU.SG v3
                                                        WHERE v2.po_cont_code = v3.po_cont_code
                                                          AND v2.line_no = v3.line_no
                                                          AND v2.location_line_no = v3.location_line_no
                                                          AND v2.fs_timestamp = v3.fs_timestamp
                                                          AND v3.tx_timestamp IS  NULL
                                                 ) ORDER BY v2.location_line_no
                                              ) FROM xgbz_fin_stage_ack_pol_v@dev_1157.RP.EDU.SG v2
                                               WHERE v2.line_no = v1.line_no
                                                 AND v2.po_cont_code = v1.po_cont_code
                                                 AND v2.fs_timestamp = v1.fs_timestamp
                                                 AND v2.TX_TIMESTAMP IS NULL
                             ) ORDER BY v1.line_no
                         ) dtls
                    FROM xgbz_fin_stage_ack_poh_v@dev_1157.rp.edu.sg poh,
                         xgbz_fin_stage_ack_pod_v@dev_1157.rp.edu.sg v1
                   WHERE v1.po_cont_code = poh.po_cont_code
                     AND v1.fs_timestamp = poh.fs_timestamp
                     AND v1.tx_timestamp IS NULL
                     AND poh.tx_timestamp IS NULL
                     AND poh.po_cont_code = rec_po_ack.po_cont_code
                   GROUP BY poh.po_cont_code,poh.ext_system_code,poh.amendment_no,poh.variation_no,poh.exception_code,poh.exception_long_desc,
                            poh.ministry_code, poh.dept_code)This is urgent please help in this regard.
    thanks in advance.
    Regards
    Nagendra

    Hi,
    Here are two possible solutions :
    xmlelement("EXCEPTIONS",
      xmlforest(
        xmlforest(
          v1.exception_code as "EXCEPTION_CODE"
        , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
        ) as "EXCEPTION"
    )or,
    xmlelement("EXCEPTIONS",
      case when v1.exception_code is not null
             or v1.exception_long_desc is not null
        then xmlelement("EXCEPTION",
               xmlforest(
                 v1.exception_code as "EXCEPTION_CODE"
               , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
      end
    )

  • Blank xml tags; whats the deal?

    Okay here is my question. I have an XSD and two pieces of
    xml that look like this:
    snippet1:
    <myTag myattr="someVal"></myTag>
    snippet2:
    <myTag myattr="someVal"/>
    Technically speaking both mean the same thing. I validated
    both XML's using XMLSPY and they pass through. But one of
    our clent uses the old style, that is snippet1. When he
    get's snippet2, he encounters an error.
    Does any one know about this kind of issues? As in what
    part of the xml spec speaks about this? and what is this
    called in terms of parser terminology?
    Thanks in advance.

    Section 3.1: http://www.w3.org/TR/REC-xml/#sec-starttags
    And if your client gets an error when processing an empty element, they need to throw out their parser and get one that complies with the XML recommendation.

  • Q: How to access and modify xml tags using Java

    I have an xml based document that i need to access and change. For example, the code
    <section id="section1">
    <div>
    <xforms:group id="id1">
    <xforms:label id="label1">
    <l style="font-size:16pt"> something </l>
    </xforms:label>
    </xforms:group>
    </div>
    </section>
    Working with Java I need to access all the tags, select some of them that are relevant to the current device and remade the document. I thought I would read the file character by character identifying the different labels and building a tree, storing in the tree nodes the relevant information as some kind of attributes (for example, in the case of the <xforms:group id="id1"> I would name the node "xforms:group" and create an "id" attribute with value "id1"). I'm not sure if that is the most efficient way of accessing the problem (computational power might be an issue), and would appreciate some help on the subject.
    Thanks,

    this may help you..
    this is a little util i made to help me read/write files.
    using this, you are only one step away from your solutions, you only need to figure out the regex you need to run on the text of the file to make it become what you need it to become.
    though if you use non-standard encoding, you might not want to use this code..
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Arrays;
    public class ASCIIFile {
         private File file;
         private StringBuilder builder;
         public ASCIIFile(String path) throws IOException{
              file = new File(path);
              openFile();
         public ASCIIFile(File file) throws IOException{
              this.file = file;
              openFile();
         public void setNewFileName(String fileName){
              file = new File(file.getAbsolutePath(), fileName);
         public void setNewFilePath(String filePath){
              file = new File(filePath, file.getName());
         private void openFile() throws IOException{
              if(!file.exists()) file.createNewFile();
              BufferedReader read = new BufferedReader(new FileReader(file));
              String line = read.readLine();
              builder = new StringBuilder();
              while(line != null){
                   builder.append(line);
                   builder.append("\n");
                   line = read.readLine();
              read.close();
         public String getContents(){
              return builder.toString();
         public StringBuilder getStringBuilder(){
              return builder;
         public void setStringBuilder(StringBuilder b) throws IOException{
              setContents(b.toString());
         public void setContents(String contents) throws IOException{
              FileWriter writer = new FileWriter(file);
              writer.write(contents);
              writer.flush();
              writer.close();
              builder = new StringBuilder(contents);
         public static File[] getAllFilesUnderDir(String fullpath, boolean recursive) {
              ArrayList queue = new ArrayList(10);
              ArrayList matched = new ArrayList();
              File root = new File(fullpath);
              File[] files = root.listFiles();
              if (files == null || files.length == 0) {
                   return new File[] {};
              queue.addAll(Arrays.asList(files));
              for (int j = 0; j < queue.size(); j++) {
                   File child = (File) queue.get(j);
                   if (child.isDirectory() && recursive) {
                        files = child.listFiles();
                        if (files != null) {
                             queue.addAll(Arrays.asList(files));
                   } else { // child is file
                        matched.add(child);
              return (matched.size() > 0)?((File[]) matched.toArray(new File[] {})):(new File[] {});
    }

  • Search and Replace XML TAG using JAVA

    Hi All,
    I have an XML file, say RESULT.XML Which has about 30000 Lines (yes Thirty Thousand ). For some reason i need to replace an existing tag with a different tag(not the value inside the tag, But the tag itself) . I am facing a challenge. I will explain it as below.
    I have a csv file which has 2 values as given below
    <VALUE A> , <VALUE B>
    where <VALUE A> is an existing node in the RESULT.XML and <VALUE B> is the node that should replace <VALUE A> in the RESULT.XML
    i have 500 such entries in the file.
    Now i need to write a program to read the csv file, Search <VALUE A> in the RESULT.XML and Replace it with <VALUE B> of the csv file.
    please let me know how do i start with this.
    I really want to fix this issue.
    Existing Node = <Product ID="role (contact) 3" UserTypeID="Product Number">_
    To be changed to = <Product ID= role (contact)3" UserTypeID="Product Number">_
    please reply if you need any further information
    Thanks in Advance
    Manzoor

    Sounds like a job for XSLT or Perl not Java though it can be done in Java. In Java I would initially try
    1) Read the csv file using one of the many free CSV parsers and build a Map<String,String>.
    2) Create a Rewriter using the map keys as targets and use the map values as replacements.
    3) Read the XML file line by line and process each line with the Rewriter.
    4) Save each line to an output file.
    For a one-off task this would probably serve but it could prove very slow if you need to run this on a daily basis.

  • Altova XML Spy parsing issue

    I wonder if anyone can help.
    Pasted below is an standard WSDL file has generated by BPEL Designer. However, XML Spy wont validate it, reporting:
    "The file is not valid. Unexpected element 'plnk:PartnerLinkType' in element definitions"
    Can anyone help?
    many thanks
    Vince
    <?xml version="1.0"?>
    <definitions name="a"
    targetNamespace="http://www.a.com"
    xmlns:tns="http://www.a.com"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    >
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TYPE DEFINITION - List of types participating in this BPEL process
    The BPEL Designer will generate default request and response types
    but you can define or import any XML Schema type and use them as part
    of the message types.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <types>
    <schema attributeFormDefault="unqualified" elementFormDefault="qualified"
    targetNamespace="http://www.a.com"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="aRequest">
    <complexType>
    <sequence>
    <element name="input" type="string"/>
    </sequence>
    </complexType>
    </element>
    <element name="aResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    </types>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    MESSAGE TYPE DEFINITION - Definition of the message types used as
    part of the port type defintions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <message name="aRequestMessage">
    <part name="payload" element="tns:aRequest"/>
    </message>
    <message name="aResponseMessage">
    <part name="payload" element="tns:aResponse"/>
    </message>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PORT TYPE DEFINITION - A port type groups a set of operations into
    a logical service unit.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- portType implemented by the a BPEL process -->
    <portType name="a">
    <operation name="process">
    <input message="tns:aRequestMessage" />
    <output message="tns:aResponseMessage"/>
    </operation>
    </portType>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PARTNER LINK TYPE DEFINITION
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <plnk:partnerLinkType name="a">
    <plnk:role name="aProvider">
    <plnk:portType name="tns:a"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

    Alexander,
    There is a WSDL tutorial in User Manual of Altova XML Spy Help. Just go through that which gives you an idea of how to generate the WSDL file.
    Also go through this weblogs which may give some information:
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    ---Satish

  • b and /b xml tags displayed in pdf

    hi Experts,
    I am using 10.1.3.3.2
    I am displaying the fillter view along with the report on the dashboard. When I generate the pdf (printer friendly -> PDF) for that, the dates between filter condition is showing the <b>and</b> tags around 'and' instead of displaying 'and' in bold.
    I.e it is displayed as- Maturity Date is between *01/07/2010* <b>and</b>*31/07/2010*
    while it should be-
    Maturity Date is between *01/07/2010 and 31/07/2010*
    In the html view it is correct. The problem is in pdf.
    Has anyone got a solution for removing the <b>and</b> tags?

    The problem is pdf format will display HTML tags. If you want to get rid of the tags, rewrite your "between" filter like this:
    Maturity Date >= 01/07/2010
    And
    Maturity Date <= 31/07/2010
    The "And" here will not display with the HTML tags when you save the report to pdf.

Maybe you are looking for

  • Adding messages to the Variable entry screen in web report

    I need to add a message or note to the variable selection screen on a web report. I need this message or note to be displayed somewhere on the same screen with the variable list. I found something similar in BW Expert regarding pop-up messages, but t

  • Camera Roll on iphone 4S doesn't show up on ipad2

    Camera Roll on iphone 4S doesn't show up on ipad2, I have icloud on on both devices, in settings have icloud sharing turned on. Ther is no sync command. Oh, do I have to go through itunes to accomplish this? I thought that if it was turned on on both

  • Why the video calls under the Skype are still not fixed in the last update?

    I am deeply dissapointed with the last update to the operating system of my new (2013) MacBook Air. The video calls didn't work, but I have followed one of the remedy on the net and made it working. After the update the problem returned. This problem

  • Importing FCP7 projects in FCPX 10.1.1

    Hello I just installed Mavericks and FCPX 10.1.1 on another boot drive to test if I can handle the switch to FCPX. Is it possible to import any FCP7 projects into FCPX ? Thought it's best to ask before trying it and messing something up. They are pre

  • Selling through my site

    I have a computer tech business where i provide services to fix and setup machines. Lately, i have started purchasing used machines and refurbishing them with the hope to sell them, and i would like to use my site to do it, rather than go through a p