Ignore DOCTYPE tag in xml

Hi!,
I need to remove DOCTYPE tag from the xml file. The parser is trying to validate the DTD. I do not want to validate, I just want to parse. I could not find any documentation on how this can be done. if any one of you have done this please let me know how you have managed to ignore the DOCTYPE tag.
Regards

Here is one way to do it:
Example taglib DOCTYPE:
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
Example Code:
// Get your parser, then set its EntityResolver to your own custom er.
parser.setEntityResolver(new EntityResolver()
public InputSource resolveEntity(String publicId, String systemId)
if ("-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN".equals(publicId))
return new InputSource(
new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes()));
else
return null;
});

Similar Messages

  • Ignore DOCTYPE tag in XML Validation

    All,
    I am trying to read an XML file using a file adapter with passing using the XSD created out of that XML. In normal scenario it works fines. Problems comes when I cam trying to read the XML file which had the Tag <!DOCTYPE> as shown below on top of the root node.
    In this case XML parsing is failing and file adapter is throwing the error.
    Any pointers on this.
    Many Thanks.
    Regards,
    Ramana.
    Sample XML (For Example):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE CFXML [
    <!ELEMENT CFXML (thisDocumentGenerationDateTime,thisDocumentIdentifier,CFData)>
    <!ELEMENT thisDocumentGenerationDateTime (DateTimeStamp)>
    <!ELEMENT thisDocumentIdentifier (ProprietaryDocumentIdentifier)>
    <!ELEMENT CFData (ProprietaryInformation*,ProductLineItem+,CFReportBLOB?)>
    <!ELEMENT DateTimeStamp (#PCDATA)>
    <!ELEMENT ProprietaryDocumentIdentifier (#PCDATA)>
    <!ELEMENT ProprietaryInformation (Name,Value)>
    <!ELEMENT ProductLineItem ( ProductLineNumber , TransactionType , CPUSIUvalue , ConfigurationControlNumber?, ProprietaryGroupIdentifier , ServicePacLineNumberReference? , Quantity , ProductIdentification , UnitListPrice? , MaintenanceUnitListPrice? , ProductSubLineItem* ) >
    <!ELEMENT CFReportBLOB (#PCDATA)>
    <!ELEMENT Name (#PCDATA)>
    <!ELEMENT Value (#PCDATA)>
    <!ELEMENT CPUSIUvalue (#PCDATA)>
    <!ELEMENT ConfigurationControlNumber (#PCDATA)>
    <!ELEMENT ProductLineNumber (#PCDATA)>
    <!ELEMENT ProprietaryGroupIdentifier (#PCDATA)>
    <!ELEMENT ServicePacLineNumberReference (#PCDATA)>
    <!ELEMENT Quantity (#PCDATA)>
    <!ELEMENT TransactionType (#PCDATA)>
    <!ELEMENT ProductIdentification (PartnerProductIdentification*) >
    <!ELEMENT ProductSubLineItem ( LineNumber, TransactionType, Quantity , ExchangeAddSubLineItemNumber? , ProductIdentification, UnitListPrice?,MaintenanceUnitListPrice?)>
    <!ELEMENT UnitListPrice ( FinancialAmount, PriceTerm)>
    <!ELEMENT MaintenanceUnitListPrice (FinancialAmount, PriceTerm)>
    <!ELEMENT PartnerProductIdentification ( OrderedProductIdentifier?, ProprietaryProductIdentifier, ProductDescription?, ProductTypeCode?, ProductIdentifierTypeCode?) >
    <!ELEMENT LineNumber (#PCDATA)>
    <!ELEMENT ExchangeAddSubLineItemNumber (#PCDATA)>
    <!ELEMENT FinancialAmount ( GlobalCurrencyCode, MonetaryAmount )>
    <!ELEMENT PriceTerm (#PCDATA)>
    <!ELEMENT OrderedProductIdentifier (#PCDATA)>
    <!ELEMENT ProprietaryProductIdentifier (#PCDATA)>
    <!ELEMENT ProductDescription (#PCDATA)>
    <!ELEMENT ProductTypeCode (#PCDATA)>
    <!ELEMENT ProductIdentifierTypeCode (#PCDATA)>
    <!ELEMENT GlobalCurrencyCode (#PCDATA)>
    <!ELEMENT MonetaryAmount (#PCDATA)>
    ]>
    <CFXML>
    <thisDocumentGenerationDateTime>
    <DateTimeStamp>2008-05-23T14:02:49.465-05.00</DateTimeStamp>
    </thisDocumentGenerationDateTime>
    </CFXML>

    Guys,
    There is a small tricky point here. The above operation works in the simple file adapter but dosn't work for Chunk read file adapter.
    The InteractionSpec (oracle.tip.adapter.file.outbound.ChunkedInteractionSpec) of the Chunk read file adapter dosn't support this functionality. I guess we have raise an SR, if I am correct.
    -Ramana.

  • How to ignore DOCTYPE when parsing xml java?

    Hello
    i am trying to parse some sml files that have:
    <!DOCTYPE ModuleRoot SYSTEM "C:\xxx\xmlapp.dtd">
    i don;t have the dtd file
    how can i ignore it by changing my code and not changing the xml file.
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
    this.doc = documentBuilder.parse(xmlFileName);
    i got exception in this.doc = documentBuilder.parse(xmlFileName);
    (The system cannot find the path specified)
    Thanks in advance.

    You need to create an EntityResolver that returns a dummy DTD. Since you aren't actually validating, this can be as simple as:
            db.setEntityResolver(new EntityResolver()
                public InputSource resolveEntity(String publicId, String systemId)
                    throws SAXException, IOException
                    return new InputSource(new StringReader(""));
            });For more information, here's an article that I wrote on [XML parsing and validation|http://www.kdgregory.com/index.php?page=xml.parsing].

  • Java mapping for Remove and Add of  DOCTYPE Tag

    HI All,
    i have one issue while the Java mapping for Remove and Add of  DOCTYPE Tag   in Operation Mapping .
    it says that , while am testing in Configuration Test "  Problem while determining receivers using interface mapping: Error while determining root tag of XML"
    Receiver Determination...
    error in SXMB MOni
    " SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">CX_RD_PLSRV</SAP:Code>
      <SAP:P1>Problem while determining receivers using interface mapping: Error while determining root tag of XML: '<!--' or '<![CDATA[' expected</SAP:P1>
    plz provide solutions
    Thanks in advance.

    Hi Mahesh,
    I understand, you are using extended Receiver Determination using Operational Mapping (which has Java Mapping). And, there is an error message u201CError while determining root tag of XMLu201D, when you are doing configuration test.
    Can you please test, the Operational Mapping (which has Java Mapping) separately in ESR, with payload which is coming now. It should produce a XML something like this [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce53aea0d7154ee10000000a421937/frameset.htm]
    <Receivers>
    <Receiver>
      <Party agency="016" scheme="DUNS">123456789</Party>
      <Service>MyService</Service>
    </Receiver>
    <Receiver>
      <Party agency="http://sap.com/xi/XI" scheme="XIParty"></Party>
      <Service>ABC_200</Service>
    </Receiver>
    </Receivers>
    If it is not (I Think it will not), then there is some problem in Java Mapping coding. Please correct it. Last option, if your Java code is small in length; you may paste it here, so that we can have a look at the cause of issue.
    Regards,
    Raghu_Vamsee

  • How to make the tags in XML file case insensitive

    Hi,
    I have a ReadXML class which reads an xml file. This class also has a method which receives a string-child from another class and uses this string-chile to match it with the child tag in the xml file, and returns the child tag's value.
    Now, my problem is this, the child tag in xml may be in a case different from the case of the string-child received from another class.
    How do I modify it, so the program does not return a null pointer exception because the strings did not match for want of uppercase or lowercase letters.
    Thanks
    Sangeetha

    I'm not sure what you are getting at. Is a string child the contents of a node treated as text?
    If you are trying to match a child node regardless of case I doubt this is possible as the XML standard says an XML document is case sensitive so if your parser ignored case it would not be XML complient.
    Hope this helps.

  • JAXP seems to be stripping off DOCTYPE tag

    When I parse a document, the DOCTYPE tag is getting stripped off.
    To parse, I read the document from file and it looks like :
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j">
    After parsing, I dump it to the console and it looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <log4j:configuration debug="null" threshold="null" xmlns:log4j="http://jakarta.apache.org/log4j">
    The mystery the output has two attributes set to defaults, the only the parser knows this is by reading the dtd. But why does not include the DOCTYPE tag?
    The parsing code snippet is:
    Document doc = null;
    DocumentBuilderFactory dbFactory = null;
    dbFactory = DocumentBuilderFactory.newInstance();
    dbFactory.setNamespaceAware(true);
    DocumentBuilder db = dbFactory.newDocumentBuilder();
    db.setEntityResolver(new LogDTDResolver());
    doc = db.parse(is);  // is is an InputStreamAnyone have a clue? Is there a property I am missing. I have searched for the complete set of jaxp properties, but I can't find one.
    Thanks for any help.

    So it looks like log4j is doing its own parsing and it requires the DTD. Don't know how (or why) it does that.
    You call the setOutputProperty() method of the Transformer. This is designed to configure the Transformer with properties that are normally set in the <xsl:output> element of an XSL transformation. The properties you need are "doctype-system" and maybe "doctype-public".
    You're quite right, it isn't obvious. That's what happens when systems are designed by architects who believe in abstraction too much.

  • Generating !DOCTYPE tag for a Document

    I am using the SDK JAXP implementation of DOM to parse a simple XML document containing a !DOCTYPE tag, make a minor modification and write it back to a file. All works fine except that the !DOCTYPE tag is not written to the StreamResult by the Transformer.
    getDoctype() on the Document does return a Doctype object that was parsed, but it's not written when transforming the Document into a StreamResult.
    How do I write the !DOCTYPE tag into the output?
    Please help.
    Nikhil

    Set DOCTYPE_SYSTEM output property.
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, "exampleDtd.dtd");

  • Want PI to ignore Cdata tags....

    Hi folks,
    Just need your inputs,
    Can PI ignore Cdata tags in Messages?

    Hi,
    Please have a look at the following links and see if it helps you.
    CDATA tag in xml
    Handling special characters in an IDOC to XML interface using BC
    Best Regards

  • How to Include html tag in xml

    Hi,
    Is there any way to include html tags in xml?
    For Example, I'm using xsl to get the value of FIELD_1 from fetch.xml
    In fetch.xml, I have the tag
    <FIELD_1>
    <font color='#8080ff'>&#160;<font face='Times New Roman, Times' size='28'>Testing font and color</font></font>
    </FIELD_1>
    But If I tried to read the value from xsl like <xsl:value-of select="FIELD_1"/> I'm just gettig the display 'Testing font and color' without the specified font and color....
    How to achieve this?
    Thanks
    Selva.

    Hi,
    Thanks for the input.
    I tried with the below code
    <fo:block space-after="5mm" font-family="Arial"><xsl:copy-of select="FIELD_1"/></fo:block>
    But I'm getting the below error...
    "An invalid XML character (Unicode: 0xa0) was found in the element content of the document."
    Below is the code included in the xsl....
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="Values"><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
    <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="3cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
    <fo:region-body/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="simpleA4">
    <fo:flow flow-name="xsl-region-body">
    <fo:block space-after="5mm" font-family="Arial"><xsl:copy-of select="FIELD_1"/></fo:block>
    </fo:flow> </fo:page-sequence> </fo:root> </xsl:template></xsl:stylesheet>
    Is there any mistakes in the above code?
    Regards,
    Selva.

  • Add Doctype to the XML File

    Experts,
    My Scenario is JDBC to File
    For the resultant xml file i have to include a <DOCTYPE> after
    <?xml version="1.0" encoding="UTF-8" ?> while passing it to legacy system ?
    I had written an XSLT Code to acheive this, i checked in XML spy and it is working.
    but in moni iam getting an error in message mapping
    my XSLT Code is
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- Add the Doctype declaration -->
    <xsl:output method="xml" indent="no" doctype-system="http://integratex.quality.techdata.de:8080/ix/dtd/ixOrder.dtd"/>
    <!-- Identity Transform - copy the source XML to the output without any changes -->
    <xsl:template match="node() | @*">
                <ns0:MT_ASNDATAOUT xmlns:ns0="http://aaaaa/sd/SD152.25">
                <xsl:copy>
                                                    <xsl:apply-templates select="node() | @*"/>
                </xsl:copy>
                </ns0:MT_ASNDATAOUT>
    </xsl:template>
    </xsl:stylesheet>
    and the error in moni is
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>Parsing error after multi mapping.</SAP:P1>
      <SAP:P2>Expected Message<i> instead of Messages</SAP:P2>
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Parsing error after multi mapping.Expected Message<i> instead of Messages</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Iam doing multi mapping between source and target, is m ulti mapping causing the issue?
    and also check my xslt code,it is working in xml spy as desired.
    Please help me on this
    Appreciate your help.
    Thanks
    Srinivas

    Hi,
    Yes you have to chnage the DTD structure to add DOCTYPE Value,one morething when you executing XSLT mapping Multi Mapping scenario it shouls also supports multi mapping feature.Fisrt execute XSLT Mapping program without multi mapping,let me know how its behaving.
    Regards,
    Raj

  • How can we get  tag of XML file using SAX

    Hi ,
    I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
    XML file is
    <DFProperties>
    <AccessType>
    <Get/>
    </AccessType> <Description>
    gdhhd
    </Description>
    <DFFormat>
    <chr/>
    </DFFormat>
    <Scope>
    <Permanent/>
    </Scope>
    <DFTitle>gsgd</DFTitle>
    <DFType>
    <MIME>text/plain</MIME>
    </DFType>
    </DFProperties>
    I want out like GET and Permanent... means this one tag which is present inside of another tag.
    Handler class like
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if(_ACCESSTYPE.equals(localName)){
                   accessTypeElement=ACCESSTYPE;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_ACCESSTYPE.equals(_accessTypeElement)) {
                   String strValue = new String(ch, start, length);
                   System.out.println("Accestype-----------------------------> " + strValue);
                   //System.out.println(" " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_ACCESSTYPE.equals(localName)) {
                   _accessTypeElement = "";
    . please any body help me

    Hi ,
    I have one problem,Please help me.
    1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
    <Node> .............starttag1
    <NodeName>Test</NodeName>
    <Node>................starttag2
    <nodeName>test1</NodeName>
    </Node>..................endtag2
    <Node>.....................starttag3
    <NodeName><NodeName>
    <Node> .........................starttag4
    <NodeName>test4</NodeName>
    </Node>.......enddtag4
    </Node>...........end tag3
    </Node>............endtag1
    my code is below
    private final String _NODENAME = "NodeName";
    private final String _NODE = "Node";
    private String _nodeElement = "";
         private String _NodeNameElement = "";
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    if(_NODE.equals(localName)){
         System.out.println("start");
         if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_NODENAME.equals(_NodeNameElement)) {
                   String strValue = new String(ch, start, length);
                   String sttt=strValue;
                   System.out.println("NODENAME: ************* " + strValue);
    if(_NODE.equals(_nodeElement)){
                   if (_NODENAME.equals(_NodeNameElement)) {
                        String strValue = new String(ch, start, length);
                        String sttt=strValue;
                        System.out.println("nodevalue********** " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_NODENAME.equals(localName)) {
                   _NodeNameElement = "";
    if(_NODE.equals(localName)){
                   System.out.println("NODENAME: %%%%%%%%%");
    please help me. How can I figure node ending for particular nodename

  • 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.

  • Changing data in XML variable and appending tags in XML  document

    Hi all,
    I am new to weblogic Integrator . can any one help me concerning following problem
    1. I get input XML message to my workflow which I stores in XML variable. after
    some processing i want to change value of one tag in XML stored in XML variable.
    How I can do thaat ?
    2. I have some XML like
    <root>
    <child>
    <a> </A>
    </child>
    <child>
    </child>
    </root>
    and i want to append multiple such tag at run time . how i can do the same
    in wli
    Please let me know your suggestion
    Kiran

    For both cases I suggest you use XSLT.
    Mike
    "Kiran" <[email protected]> wrote in message
    news:3c720cd2$[email protected]..
    >
    Hi all,
    I am new to weblogic Integrator . can any one help me concerning followingproblem
    1. I get input XML message to my workflow which I stores in XML variable.after
    some processing i want to change value of one tag in XML stored in XMLvariable.
    How I can do thaat ?
    2. I have some XML like
    <root>
    <child>
    <a> </A>
    </child>
    <child>
    </child>
    </root>
    and i want to append multiple such tag at run time . how i can do thesame
    in wli
    Please let me know your suggestion
    Kiran

  • How use forEach tag in xml tag library

    Hi,
    Can u please explain the procedure for using forEach tag for displaying the parsed xml tags?
    This is the code snippet
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <html>
    <body>
         <c:import url="\books.xml" var="url" />
         <x:parse xml="${url}" var="doc" />
              <x:forEach var="n" select="${doc}/books/book">
                   <x:out select="${n}/title"/>
                   <x:out select="${n}/author" />
         </x:forEach>
    </body>
    </html>
    but I got the fallowing error.
    java.lang.NoClassDefFoundError: org/saxpath/SAXPathException
         at org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(ForEachTag.java:51)
         at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:262)
         at jsp_servlet.__index._jspService(__index.java:197)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Just the same way as you do in JSP. Since JSF 1.2 you can use unified EL #{ } in c:forEach.
    You can also use Tomahawk's [t:dataList|http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_dataList.html] by the way. It is more efficient.

  • Closing tag in xml transformation

    Hi experts,
    I have the following ABAP code:
    ABAP itab to XML string
      CALL TRANSFORMATION id SOURCE data = ti_stocks[]
                             RESULT XML    ps_output.
    The result in ps_output should be an xml like this
    <?xml version="1.0" encoding="utf-16" ?>
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <DATA>
    <ZTABLE_STO>
      <FIELD1 /> ABC</FIELD1>
      <FIELD2 />0300</FIELD2>
      <FIELD3 />1</FIELD3>
      </ZTABLE_STO>
    etc.
    However, if my internal table ti_stocks contains the field1 with an empty value then the xml is incorrect without its corresponding closing tag:
    <?xml version="1.0" encoding="utf-16" ?>
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <DATA>
    <ZTABLE_STO>
      <FIELD1 />
      <FIELD2 />0300</FIELD2>
      <FIELD3 />1</FIELD3>
      </ZTABLE_STO>
    etc.
    How can I resolve this problem? I would like to have an open tag and a closing tag for every field.
    FIELD1 is a char type field.
    Thank you,
    Oscar
    Edited by: Oscar Arranz on Jan 26, 2012 2:46 PM

    Hello everyone, sorry for my english, I had the same requeriment for the end tag, the simple transformation give this result <xxx/> when the value was empty, and I did something similar to Oscar,
    i did the simple transformation and the result whas and xstring, i used a function to pass it to string, and then I make a replacement.
    here is some code:
    *  Genera XML
       data: xml_xstring          type xstring.
       data: w_xml                 type string.
       data: ixml                    type ref to if_ixml,
               streamfactory      type ref to if_ixml_stream_factory,
               encoding             type ref to if_ixml_encoding,
               ixml_ostream      type ref to if_ixml_ostream.
       data: resstream           type ref to if_ixml_ostream.
    ****Create an instance of the Ixml Processor
       ixml = cl_ixml=>create( ).
    *  ****Create the Stream Factory
       streamfactory = ixml->create_stream_factory( ).
    *  ****Create an Endcoding and Byte Order
       encoding = ixml->create_encoding( character_set = 'ISO-8859-1' byte_order = 0 ).
    *  *  ****Create the output stream with a pointer to our binary string
       ixml_ostream = streamfactory->create_ostream_xstring( xml_xstring ).
    *  ****Set the Encoding into a stream
       ixml_ostream->set_encoding( encoding = encoding ).
    ****Call simple Transformation
       call transformation zdte_libros
       source zcaratula = x_doc
       result xml ixml_ostream.
    *From xstring to string.
       call function 'HR_RU_CONVERT_HEX_TO_STRING'
              exporting
                     xstring = xml_xstring
              importing
                     cstring = w_xml.
    * <xxx/> to <xxx><xxx/>
       replace all occurrences of regex '<([^><\s]+)( [^><]+)?/>' in w_xml with '<$1$2></$1>'.
    Hope it helps someone with the same problem .

Maybe you are looking for

  • Not able to View data in .CSV file

    Hi, I am using some java script to display data conditionall, for color coding purpose but when i try to download the data to an spread sheet i am not able to do that please suggest me how to export fix this bug select case TRUNC(( ( (NVL(Z."AEWP",0)

  • Query Report:To Retrieve Data from A/R Invoice and A/P Invoice

    Hii Experts,       I am a new Sap B1 Trainee.I am facing a problem when retrieving data from A/R Invoice and A/P Invoice in order to track Expenditure and Revenue according to a Bussiness partner, I am using union to retrieve the information,but it i

  • Exporting to PDF and Excel

    Hi , When trying to export the data in to excel and PDF only the table content is getting exported but not the title of the report . How can I even export  the title of the report ? Thanks Sany

  • Can i put ME-SYNC_USER in T01?

    Hi, i did an application with syncbo S01, and i put the ME-SYNC_USER in each syncbo... Now, i´m doing an application with some syncbo T01, can i put ME-SYNC_USER too and in getlist and gedetail filter with this user? Thanks,

  • TV settings

    How do I change my settings for my tv once I've programmed my remote? I can get the settings guide to pull up but can't adjust them with uverse remote. Also can't use my tv remote to change the settings now that the uverse remote is programmed.