Skip to Content
author's profile photo Former Member
Former Member

how to add an xml start tag to an xml document?

Hi

I would like to add this xml tag to my xml document i PI 7.1:

<?xml-stylesheet type="text/xsl" href="xcbl_invoice_stylesheet.xsl" ?>

Before:

<Invoice>

<InvoiceHeader>

<InvoiceNumber>

<Reference>

<RefNum>8858382</RefNum>

</Reference>

</InvoiceNumber>

......

after:

<?xml-stylesheet type="text/xsl" href="xcbl_invoice_stylesheet.xsl" ?>

<Invoice>

<InvoiceHeader>

<InvoiceNumber>

<Reference>

<RefNum>8858382</RefNum>

</Reference>

</InvoiceNumber>

......

What is the esiest way to do that?

BR

MIkael

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 10, 2009 at 12:33 PM

    Hi,

    You can use java mapping to add the same

    in interface determination :

    1. First mapping will convert the source to target structure

    2. Second mapping (java mapping) will add the necessary <xsl> tag

    Regards

    Suraj

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      I meant to read the entire source into a stringbuffer. Append xsl structure to it and convert it directly to a XML structure.

      Never thought of including DOM or SAX technology

      Something like this:

      DOMParser parser = new DOMParser();
      parser.parse(new InputSource(new java.io.StringReader(xml))); // xml is a
      string containing xml
      Document doc = parser.getDocument();
      

      Regards

      Suraj

      Edited by: S.R.Suraj on Sep 10, 2009 9:27 AM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.