Customer Portal

Q: Stripping newline chars from an XML document

Comments 2

  • Avatar
    tkramolis
    0
    Comment actions Permalink
    Hi Tony,

    Your solution seems to be correct, there has to be only a minor change required. Here's my suggestion:

    I would use the UniversalDataReader to read the whole imput XML into single field of single record. This requires the output edge metadata to be properly configured: Create metadata with single field and clear value of the "Record delimiter" record metadata property. Also set the "EOF as delimiter" property of the single metadata field to true.

    Then use the Reformatter with replace function to strip the new line characters...

    Attached is a demo graph which strips the new lines of the read XML and prints the result into the log using the Trash component.

    Regards,
    Tom

    Javlin
  • Avatar
    jurban
    0
    Comment actions Permalink
    Hi Tony,

    just one note - you need to be careful about the size of the XML. The whole XML content needs to fit into the edges, so the size is limited by the Record.MAX_RECORD_SIZE property, see documentation here. The current default of MAX_RECORD_SIZE is 64KB, so you might need to modify it depending on your data - however, increasing the value increases memory consumption of the graph.

    In CloverETL 3.2 we'll have edges that can "grow" dynamically as needed, so they'll be more suitable to transport large data in each record. They'll have a default maximum size of 32MB.

    Best regards,
    Jaro

Please sign in to leave a comment.