PDA

View Full Version : using "line weights" for alignment


jmastro
16-Apr-2004, 02:08 PM
I want to compare somthing like the following:

<file RelativePath="aa" SubType="xx"/>
<file RelativePath="bb" SubType="xx"/>
<file RelativePath="cc" SubType="xx"/>
<file RelativePath="dd" SubType="xx"/>

against:
<file
RelativePath="aa"
SubType="xx"
/>
<file
RelativePath="BbBb"
SubType="xx"
/>
<file
RelativePath="cc"
SubType="yyyy"
/>
<file
RelativePath="DeeDee"
SubType="xx"
/>

That is, the spaces are different and some actual changes.

I tried using
^\s*<File
as regular expression with weigth of 5000 to align the "<File" tags.

It aligns each "<File" with each line of
<File
RelativePath=...
SubType=...
etc.

I resolved this case using de HTMLTidy.zip downloaded here.
But i have similar cases that are not XML nor HTML.

Is this Regular Expression correct? and the weight?
or do I have to modify something else, like "Align similar lines" or Skew tolerance"

Thanks in advance for any info.

Chris
16-Apr-2004, 03:07 PM
The regular expression is correct.

The problem is that you are trying to compare text on a single line on one side to multiple lines of text on the other side.

BC only supports single line comparisons.

If you want to compare them in BC you need something to convert the text on the right into equivalent one line chunks. If you can find a program or write a script in your favorite scripting language to convert the file, you can call it as an external converter from a BC rule.