IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  How to add Xml stylesheet header to a xmlstring

    Posted Wed April 15, 2009 04:08 PM

    Hi,

    We want to add a xml stylesheet header to a xml string generated from an IS document using documentToXMLString service.

    If we set ‘addHeader’ to ‘true’, xml header “<?xml version="1.0" encoding="ISO-8859-15"?>” is getting added. Along with this header, we want stylesheet header also in the xml.

    Our xml string should look like:

    <?xml version="1.0" encoding="ISO-8859-15"?> <?xml-stylesheet type="text/xsl" href="Finvoice.xsl"?>

    where is the first level xml tag.

    We tried adding a document ‘?xml-stylesheet’ with attirbutes ‘@type’ & ‘@href’ but that document was considered as a tag and xml data becomes a invalid xml due to two tags ‘xml-stylesheet’ & ‘Finvoice’ at same level.

    Please advise.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: How to add Xml stylesheet header to a xmlstring

    Posted Wed April 15, 2009 05:34 PM

    What system is flagging the XML as not well-formed? Is it IS? Is something generating an error?

    As far as I can tell the xml-stylesheet processing instruction is correct and in the right place. According to [URL]http://www.w3.org/TR/xml-stylesheet/[/URL] “The xml-stylesheet processing instruction is parsed in the same way as a start-tag…” so perhaps it just looks to be not well-formed during processing but in fact actually is.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 3.  RE: How to add Xml stylesheet header to a xmlstring

    Posted Thu April 16, 2009 06:56 AM

    I think I haven`t written my case properly. Actually I want final xml to look like below:

    <?xml version="1.0" encoding="ISO-8859-15"?> <?xml-stylesheet type="text/xsl" href="Finvoice.xsl"?>

    But to acheive this, we tried adding a document ‘?xml-stylesheet’ with attirbutes ‘@type’ & ‘@href’ with appropriate values and finally we got the xml string output as below:

    <?xml version="1.0" encoding="ISO-8859-15"?> <?xml-stylesheet type="text/xsl" href="Finvoice.xsl"/> which was throwing an invalid xml error when we try to open it in browser. So my actual query on the post is, how to add a proper stylesheet header to my xml string?
    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: How to add Xml stylesheet header to a xmlstring

    Posted Thu April 16, 2009 05:57 PM

    A search of Advantage shows that this type of question has been asked before but not resolved. Bummer.

    One way to do this is to set addHeader to false on the documentToXMLString call and then prepend the desired prolog (declaration and processing instruction) to the string using pub.string:concat. Not memory friendly but workable.

    Perhaps tech support would have a better idea. Or maybe there is an unadvertised fix/enhancement available for properly handling processing instructions in both documentToXMLString and xmlStringToXMLNode/xmlNodeToDocument.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 5.  RE: How to add Xml stylesheet header to a xmlstring

    Posted Fri April 17, 2009 01:21 PM

    Thanks Reamon. As a temporary fix, we have used the concat service & acheived it.

    Will raise a case to Tech Team and let u know once we got any reply.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB