Buggy Find/Replace in Files with long lines and XPath
Posted: Tue Dec 28, 2010 9:21 pm
I have just discovered that some XPath searches on project files are returning incomplete results, and I have identified the cause (or "a cause" at least) as long lines in the source XML.
Description:
I want to search through all files in a project for a regular expression \d\s+\d (match digits separated by space) within the XML element <pg>. My XML files contain elements like this:
where the regex search should match the final <pg> element in the given <entry>.
Running Find/Replace in my project files failed to match this data.
I then tried format-and-indent on the source, to produce
saved the file, and then I ran the project search again. This time the final <pg> was correctly matched.
The *only* thing I changed in the file was whitespace in the formatting. So this appears to be a bug in the oXygen search in cases of long lines.
Description:
I want to search through all files in a project for a regular expression \d\s+\d (match digits separated by space) within the XML element <pg>. My XML files contain elements like this:
Code: Select all
<entry><head>House, Mrs. Mary</head><pgW><pg>2</pg><pg>13 and n.</pg><pg>55</pg><pg>173–74 n. 1</pg><pg>178</pg><pg>196</pg><pg>272 n. 1</pg><pg>308</pg><pg>345 n.1 449</pg></pgW></entry>
Running Find/Replace in my project files failed to match this data.
I then tried format-and-indent on the source, to produce
Code: Select all
<entry>
<head>House, Mrs. Mary</head>
<pgW>
<pg>2</pg>
<pg>13 and n.</pg>
<pg>55</pg>
<pg>173–74 n. 1</pg>
<pg>178</pg>
<pg>196</pg>
<pg>272 n. 1</pg>
<pg>308</pg>
<pg>345 n.1 449</pg>
</pgW>
</entry>
The *only* thing I changed in the file was whitespace in the formatting. So this appears to be a bug in the oXygen search in cases of long lines.