xml values converter

Hello,

I have a simple xml file (in a MAP):

<?xml version="1.0" encoding="UTF-8" ?> Texto true 11,5

And I need to convert to a document with the same structure, but with definied types:
field1 - string
field2 - boolean
field3 - float

So, I create a document with that structure with these properties:
field1 = Data type String
field2 = Data type Object and java wrapper type java.lang.Boolean
field3 = Data type Object and java wrapper type java.lang.Float

And make this flow steps:
pub.xml:xmlStringToXMLNode
pub.xml:xmlNodeToDocument -> in this step I had modified the properties:
documentTypeName : with my fully qualified name of the document type

but the document has all 3 values in string format…

it’s possible to convert values with these steps? If so, what’s I’m doing wrong?

Thank you for helping me!

Hi Welder,

Yes you will have all the 3 values in the string format only n the pipeline doc, however if you define a Schema for that corresponding docType you created in reality when you validate the Document agains schema (pub.schema:Validate) service if the XML sample is this way technically the Flow service will work as expected even though you see them all as strings in the pipeline out.

HTH,
RMG

Hi RMG,

Thank you for your reply, but I can’t do what you recommend.
I need create a schema from the document? I try this: created one from pub.schema:createXSD, got the source and has imported in my project with a schema from this file.
But, when I make MAP, only string fields has values.