Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Catalog Manager XML Replace Using Regex

RandomNumberJan 15 2014 — edited Jan 15 2014

Hello all, I am trying to use regular expression in an xml file to be parsed by Catalog Managers XML search and replace. Oracle documentation says that Javascript Regex can be used in the XML file, however i keep running into errors with special characters it seems that the values are not being read as REGEX syntax but as string literals. I can not find an example of REGEX being used in XML for this application anywhere in my searches.

This document says it is possible:

Configuring and Managing the Oracle BI Presentation Catalog - 11g Release 1 (11.1.1)

Here is an example block

<?xml version="1.0" encoding="utf-8"?>

<actions>

<action command="textReplace" oldValue="op="and\">" newValue="$1\n <sawx:expr op="prompted" xsi:type="sawx:special"><sawx:expr xsi:type="sawx:sqlExpression">"Table"."Column"</sawx:expr> </sawx:expr> ignoreCase="false"/>

</actions>

In this process I am trying to find the FILTER blocks AND section by searching for op="and\"> then i dont want to replace that, i want to add <sawx:expr op="prompted" xsi:type="sawx:special"><sawx:expr xsi:type="sawx:sqlExpression">"Table"."Column"</sawx:expr> </sawx:expr> to it. The $1\n is the regex that would insert my newValue text after finding my oldValue text on a new line.

When trying to trun this example code I get an error from catalog manager.

XML IS NOT WELL FORMED ERROR ON LINE 3: ELEMENT TYPE "ACTION" MUST BE FOLLOWED BY EITHER ATTRIBUTE SPECIFICATIONS, ">" or "/>".

EDIT UPDATE:

I have updated the XML to escape the special characters

" &quot;
' &apos;
< &lt;
> &gt;
& &amp;  

I am still getting the error from above.. I did a test using a very simple code block

<?xml version="1.0" encoding="utf-8"?>

<actions>

<action command="textReplace" oldValue="asdf" newValue="asdf" ignoreCase="false"/>

</actions>

The error implies that the <action /> tag is not formed correctly.

Comments
Locked Post
New comments cannot be posted to this locked post.