bildwelt
E2E FORUM
E2E Bridge E2E Commerce

xmlToClass() XML-Parser without XSD and Class

E2E Forum Modeling & Development xmlToClass() XML-Parser without XSD and Class

This topic contains 3 replies, has 3 voices, and was last updated by  Jörg 2 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1829

    Chensheng
    Moderator

    Hello,

    is it possible to parse a XML from String using xmlToClass() if we do not have the relevant XSD and we do not know the class structure?

    The Case:
    The customer calls the SOAP service and send a request with an entire XML in one single string parameter as input. The escaped special character from the string parameter should be decoded (unescaped) in E2E before the content be sent to the receiver.

    e.g. “C+&+a+m+p+;+S” should be decoded like “C&S”
    -> sorry, the special character will be already decoded here. Therefore i muss put the plus between.

    thanks,
    Chensheng

    #1830

    Alfred
    Moderator

    It is only possible with xmlToClass() if you create the UML classes by hand instead of importing a XML Schema.

    You could write a little Java class which does the XML parsing and with the Java adapter you can call the Java class from your UML model.

    Perhaps it is also possible to use the XSLT adapter.

    #1831

    Chensheng
    Moderator

    Great tips. Thanks a lot!

    #1832

    Jörg
    Moderator

    In my opinion the reveiver has to parse the XML. The parser will do the unescaping for the XML parameter entities. So “&+amp+;” would be transformed to “&”, or “&+auml+;” to “ä”.

    It could be also dangerous if “&+lt+;” is transformed to “<“. This could make the XML stream not well formed anymore.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.