Mantis - Quercus
Viewing Issue Advanced Details
3283 minor always 01-19-09 04:47 01-19-09 04:47
philz  
 
normal  
new 3.1.2  
open  
none    
none  
0003283: CData sections don't appear to work with SimpleElement
When using SimpleElement with CData sections, does not pick up data within CDATA section.

When attempting to output the mapping element using the code below, content only appears for the first table element in Quercus.

When using PHP on Apache, appears in both.
Using following PHP


// method declaration
    public function buildDoc($xmlString) {
        
        $content = file_get_contents($xmlString);
        $xml = new SimpleXMLElement($content);
        
        foreach ($xml->import as $import) {
           foreach ($import->table as $table) {

               $name = $table['name'];
               $filter = $table['filter'];
               $variable = $table['variable'];
               $mapping = $table->mapping;
               
                   echo "Name: " . $name . "
";
                   echo "Filter: " . $filter . "
";
                   echo "Variable:" . $variable . "
";
                   echo "Mapping: " . $mapping . "
";
           }
        }
    }

Reading the following XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<imports>
    <import>
        <table
            name = "orders"
            filter = "order_id"
            variable = "order_id">
            <mapping>
order_reference=externalReference;
contact_name=customer.contactName;
            </mapping>
        </table>
        <table
            name = "order_line"
            filter = "order_id"
            variable = "order_id">
            <sql>
select quantity, product_cfrom order_line, product
where order_line.product_id = product.product_id
            </sql>
            <mapping>
<![CDATA[
quantity=orderLine.[index].quantity
product_code=orderLine.[index].quantity
]]>
            </mapping>
        </table>
    </import>
</imports>

There are no notes attached to this issue.