NetTalk Central

Author Topic: xml import of dictionary is not getting the expected lines (boundary problem)  (Read 10943 times)

joep

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • Email
Hi all,

I'm trying to compare 2 xml files. Actually 2 exported dictionary's.
This is the example of one:

<?xml version="1.0" encoding="UTF-8"?>
<Dictionary Name="aagwin" Version="1" DctxFormat="4">
   <Table Guid="{314a1615-7fe0-4c3e-8b83-ccff9bf2f3a8}" Ident="96" Name="Alg000">
      <Audit CreateUser="Administrator" CreateDate="25 JUN 2012" CreateTime="12:01:56PM" CreateVersionNumber="1"/>
      <Field Guid="{d0373689-0dbd-4ba0-9b58-8d13f4ac6b05}" Ident="7092" Name="RecId" DataType="LONG" Size="4" ScreenPicture="@n-14">
         <WindowControl>
            <Line Text=" PROMPT(&apos;Rec Id:&apos;),USE(?Alg000:RecId:Prompt)"/>
            <Line Text=" ENTRY(@n-14),USE(Alg000:RecId),REQ"/>
         </WindowControl>
         <Audit CreateUser="Administrator" CreateDate="25 JUN 2012" CreateTime="12:01:56PM" CreateVersionNumber="1"/>
         <Validity Check="NONZERO"/>
      </Field>
      <Field Guid="{aaf2b4ea-a3c6-483d-9155-e9cb6d5b4f95}" Ident="1462" Name="MutDat" DataType="STRING" )">
         <WindowControl>
            <Line Text=" PROMPT(&apos;Mut Dat:&apos;),USE(?Alg000:MutDat:Prompt)"/>
            <Line Text=" ENTRY(@s8),USE(Alg000:MutDat)"/>
         </WindowControl>
         <Audit CreateUser="Administrator" CreateDate="25 JUN 2012" CreateTime="12:01:56PM" CreateVersionNumber="1"/>
         <Validity Check="NOCHECKS"/>
      </Field>
           <Key Guid="{d5ef9fcb-8fe3-4e23-96ca-10a64578b530}" Ident="884" Order="1" Name="PK_Alg000" KeyType="KEY" Unique="true">
         <Audit CreateUser="Administrator" CreateDate="25 JUN 2012" CreateTime="12:01:56PM" CreateVersionNumber="1"
         <Component Guid="{d7b8dcfe-8bf3-44c2-afeb-e724450f4790}" FieldId="{d0373689-0dbd-4ba0-9b58-8d13f4ac6b05}" Order="1" Ascend="true">
            <Audit CreateUser="Administrator" CreateDate="25 JUN 2012" CreateTime="12:01:56PM" CreateVersionNumber="1"/>
         </Component>
      </Key>
   </Table>
</Dictionary>

I do a  xml.load(queue,xmlfile,'Dictionary','Table')
But I keep getting the Ident and Name values from the last tag <Key
Instead of the ones from the <table line.
Can someone explain me what I'm doing wrong.

Thanks Joep
Clarion C8
Xfiles 2.33
« Last Edit: September 12, 2012, 12:37:03 AM by joep »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: xml boundary is not getting the expected lines
« Reply #1 on: September 11, 2012, 05:12:55 AM »
the dictionary is a reasonably complex  structure, with a lot of groups and queues inside each other etc.
Unfortunately I haven't made an example that imports it - but the basic premise would be to break it down into the component parts, and then build the import out slowly.

cheers
Bruce

joep

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • Email
Re: xml boundary is not getting the expected lines
« Reply #2 on: September 12, 2012, 12:34:43 AM »
Hi Bruce,

Is there no way to get to the first <guid>, <ident> en <name> values in the <table line?
An other possibillity would be to replace these tags with a "Table" prefix (<Tableguid) so they become unique for a table line.
But then I still have to spent some work to "fix" the xml before I import it.
My goal is to compare the Guid and Ident values for all table, fields en keys of both dictionary's,

Thanks Joep