Announcement Announcement Module
Collapse
No announcement yet.
Using PatternMatchingCompositeLineMapper with a array of String as entry Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using PatternMatchingCompositeLineMapper with a array of String as entry

    hi,

    I use a first reader to parse xml . One field of this message is a complicated CDATA field (several lines, delimited with a | ).

    I want to use PatternMatchingCompositeLineMapper for exmaple but I got no file as imput.

    Is there is a way to do that without having a physical file ?

    Thanks

  • #2
    Out of the box, there is no facilities within SB to parse CDATA. That being said, SB really just delegates the XML parsing to whatever parsing implementation you are using. Because of that, it's really up to the parser implementation to support that type of functionality. Castor, for example, supports custom field handlers. I would expect that you could use something like that to accomplish what you're looking for.

    Comment


    • #3
      Originally posted by mminella View Post
      Out of the box, there is no facilities within SB to parse CDATA. That being said, SB really just delegates the XML parsing to whatever parsing implementation you are using. Because of that, it's really up to the parser implementation to support that type of functionality. Castor, for example, supports custom field handlers. I would expect that you could use something like that to accomplish what you're looking for.
      Thanks for your reply. My message wasnt clear I think. I managed to parse the xml .The format is a medical one , Hl7 it is basic xml with a CSV/Fixed format in one field ( see below , i made an example)

      I parsed the xml and retrived the CDATA as a String . I made a array of String of this value
      for example :
      ZHD|201321321321321|XXXX|||||v2.3
      PID||201321321321321|h1213|201321321321321|VENDOR^ PATIENTXXX||13213213|F|||||(514)132-12132
      ORC|RE||12-1231321-HP-1|||||||||13245^XXXX^BOB
      OBX|1|HTML|HTML||

      I want to use the FlatFileItemWriter/ LineMapper/ LineTokenizer / FieldSetMapper/ DefaultLineMapper but the problem is that I havent a File as input.

      Is there a way to do it with the classes ?

      thanks


      ************************************************** *******************************
      <?xml version="1.0" encoding="UTF-8"?>
      <HL7Messages MessageFormat="XXX" MessageCount="5" Version="2.3"><Message MsgID="1"><![CDATA[MSH|^~\&|XXX|XXX|HTTPCLIENT|XXX|201321321321321||Z LI^L10|MDC13213213211|P|2.3|||ER|AL
      ZHD|201321321321321|XXXX|||||v2.3
      PID||201321321321321|h1213|201321321321321|VENDOR^ PATIENTXXX||13213213|F|||||(514)132-12132
      ORC|RE||12-1231321-HP-1|||||||||13245^XXXX^BOB
      OBX|1|HTML|HTML||<?xml version="1.0"?><html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Results For APPLIc</title>.... </body> </html>||||||F
      ]]></Message>
      ************************************************** ***

      Comment


      • #4
        If this XML isn't in a file, what is the source of it?

        Comment


        • #5
          Originally posted by mminella View Post
          If this XML isn't in a file, what is the source of it?
          the XML is a file , just the CDAT isnt . sorry if I wasnt clear .

          I juts want to do it in 2 steps :
          1) First parse the xml
          2 ) parse the CDATA like a Simple Delimited File with the LineMapper/ LineTokenizer / FieldSetMapper/ DefaultLineMapper classes.

          Comment

          Working...
          X