Trying to parse out some data that looks like this:

AAAA BB C;DDDD E FFF
GGGG;HHHH:III
JJJJ

I'm able to break out the various elements using this code:

                                                            <xs:element 
name="CmdLine" maxOccurs="unbounded" dfdl:terminator="%NL;">
                              <xs:complexType>
                                    <xs:sequence dfdl:separator=";" 
dfdl:separatorPosition="infix" >
                                          <xs:element name="Cmd" 
type="xs:string" maxOccurs="unbounded" dfdl:lengthKind="delimited" />
                                    </xs:sequence>
                              </xs:complexType>
                        </xs:element>

Which gives me output like this:

  <CmdLine>
    <Cmd>AAAA BB C</Cmd>
    <Cmd>DDDD E FFF</Cmd>
  </CmdLine>
  <CmdLine>
    <Cmd>GGGG</Cmd>
    <Cmd>HHHH:III</Cmd>
  </CmdLine>
  <CmdLine>
    <Cmd>JJJJ</Cmd>
  </CmdLine>

Is there a technique that I could use to parse the Cmd element further so that 
I could get something like this:

  <CmdLine>
    <Cmd>
      <token>AAAA</token>
      <parm1>BB</parm1>
      <parm2>C</parm2>
    </Cmd>
      <token>DDDD</token>
      <parm1>D</parm1>
      <parm2>FFF</parm2>
    </Cmd>
      <token>GGGG</token>
    </Cmd>
     ...
  </CmdLine>

Reply via email to