Announcement

Collapse
No announcement yet.

Ignoring XML Elements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ignoring XML Elements

    Hi All,
    I'm rather new to BC4, and I'm having an issue with a two XML file that I comparing.

    Each time I generate the file, a new random <question id> is generated, so I want to ignore comparison for that attribute.
    Additionally I don't care about source or scope either. How can I get BC to do this?

    File Example #1

    <qa id="VpaGetAnswer__Question--String__transfer_capabilities" label="transfer_capabilities" name="VpaGetAnswer__Question--String">
    <answer>I can only show you information about your accounts.</answer>
    <questionClass>interactive</questionClass>
    <question id="Mon_Jul_01_2013_10_47_58_1103" source="turk" scope="train">i would like to make a principal only payment to my mortgage from money market account seven seven nine four</question>
    <question id="Wed_Nov_27_2013_13_28_22_4233" source="turk" scope="train">i would like to make a principal only payments on loan zero nine eight nine</question>
    </qa>


    vs.

    File Example #2

    <qa id="VpaGetAnswer__Question--String__transfer_capabilities" label="transfer_capabilities" name="VpaGetAnswer__Question--String">
    <answer>I can only show you information about your accounts.</answer>
    <questionClass>interactive</questionClass>
    <question id="342342432424324242" source="turk" scope="train">i would like to make a principal only payment to my mortgage from money market account seven seven nine four</question>
    <question id="2342432424" source="turk" scope="train">i would like to make a principal only payments on loan zero nine eight nine</question>
    </qa>

  • #2
    Hello,

    You would want to define a new Grammar to match on this node for a File Format, then mark that grammar as Unimportant.

    For example, you could define a grammar to ignore the entire node with a Delimited grammar:
    <question id=
    to
    </question>

    We have a KB article on the subject here:
    http://www.scootersoftware.com/suppo..._unimportantv3

    Let us know if you have any questions.
    Aaron P Scooter Software

    Comment


    • #3
      I read the article and tried to set it up on V4, however once I setup the grammar using regular expression, there is no where to mark "remove" Importance as there is in the V3.

      All I want to do is remove importance to look at
      <question id="2342432424" source="turk" scope="train">

      I only want to focus on comparing whats between > and </qa>
      >i would like to make a principal only payments on loan zero nine eight nine</question>
      </qa>

      Comment


      • #4
        Hello,

        Once the grammar is defined, you would need to launch a Text Compare session, load your two text files, then go to the Session menu -> Session Settings, Importance tab.

        The Session Settings are context specific, so Importance only shows in the Text Compare, not Folder Compare level. To use as the default Rules-based scan in the Folder Compare, we would want to update the session defaults for all future Text Compares (from the Home screen, saved Sessions list, New folder, Text Compare). But first I recommend testing on a single pair of files before updating the defaults.

        I am not sure which part you are describing you want to focus on. For grammar definitions, we can either define a grammar and set that grammar as Unimportant, or define a grammar and set it as Important while making all other text Unimportant. Which text, specifically, is Unimportant in this block:
        <question id="2342432424" source="turk" scope="train">
        Aaron P Scooter Software

        Comment


        • #5
          Session menu -> Session Settings, Importance tab.

          ^ This is what I was looking for, I'm good now, and you can close this thread.

          Thanks!

          Comment

          Working...
          X