selecting xml

Craig
2007-05-20
2013-03-13
  • Craig

    Craig - 2007-05-20

    This tool does exactly what I am looking for. However I am unable to get what I am looking for. I have the following file:

    <?xml version="1.0" encoding="UTF-8" ?>
    <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
    <ERRORCODE>0</ERRORCODE>
    <PRODUCT BUILD="08-11-2005" NAME="FileMaker Pro" VERSION="8.0v1"/>
    <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="records_database" RECORDS="17820" TIMEFORMAT="h:mm:ss a"/>
    <METADATA>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="JobNumber" TYPE="NUMBER"/>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="company name" TYPE="TEXT"/></METADATA>
    <RESULTSET FOUND="2">
    <ROW MODID="57" RECORDID="122">
    <COL><DATA>921066</DATA></COL>
    <COL><DATA>Joe Products</DATA></COL>
    </ROW>
    <ROW MODID="54" RECORDID="149">
    <COL><DATA>921345</DATA></COL>
    <COL><DATA>Daves Doors</DATA></COL>
    </ROW>
    ------end of xml deleted

    I try (and many variations of):
    xml sel -t -a JobNumber /xml/filename
    I would expect to see the results:
    921066
    921345

    What am I doing wrong?

     
    • Mikhail Grushinskiy

      Your command is not nearly close to what you need to get the result you are expecting.

      Try this

      xml sel -N f=http://www.filemaker.com/fmpxmlresult -t -m //f:ROW -v f:COL/f:DATA -n file.xml

      Looking at the documentation might help you too...

      --MG

       
    • Craig

      Craig - 2007-05-20

      Thank you very much. I was looking at the man page.

      I was trying to understand your syntax and did not find the -N switch. I googled a little more and found newer documentation that has -N.

      Thanks again

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks