Skip to Content
avatar image
Former Member

Converting String to XMLDataType

As title, is there any way I can convert a String to XMLDataType?

I tried to assign it and I tried to type-cast it but it wouldn't let me do either one.

XMLDataType _XML;

String _stringXML = "<?xml version='1.0' ?> <text> Hello </text>";

_XML = _stringXML;

OR

_XML = (XMLDataType) _stringXML;

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 21, 2008 at 08:08 PM

    Tim,

    Just for clarification my assumption is that this is Java code inside of your custom action...

    The XMLDataType is based off of the org.w3c.dom.Document class and can be created by the following:

    String _stringXML = "<?xml version='1.0' ?> <text> Hello </text>";

    Document w3Doc = XMLHandler.createDocument(_stringXML);

    XMLDataType xmlDoc = new XMLDataType(w3Doc);

    The XMLHandler class is located here:

    com.sap.lhcommon.xml.XMLHandler;

    Hope this helps.

    Sam

    Add comment
    10|10000 characters needed characters exceeded