[ 
https://issues.apache.org/jira/browse/DERBY-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935631#action_12935631
 ] 

C.S. Nirmal J. Fernando commented on DERBY-4903:
------------------------------------------------

Hi Knut,

Thanks for the ideas! 

Can you please consider following.

Few negative/tricky points on doing this:
1) This way XML document becomes hard to read: It was a requirement, so that 
the user can go through a generated XML file and build up his own Style sheet.

eg: 
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet 
type="text/xsl" href="..."?>
<plan><statement>SELECT * FROM T WHERE X &lt;&gt; 'a &amp; 
b'</statement><time>2010-11-24 18:27:14.466</time></plan>

2) This need some re-factoring of the design approach:

* Now we are getting the name of the attribute from the query, we might need to 
change it.
* Now I am building the whole query plan tree and then only write the whole 
string to the file, we need to alter this approach.
etc.

3) Given the time constraint at that time, I was unable to find any other 
approach of creating the HTML file. Since creating the HTML file involves 
parsing the style sheet as well. I think we need some extra classes when 
creating the XML document. So, I am not quite sure about the presence of those 
extra classes in all JREs.

4) Element.setTextContent() method is not there in J2SE 1.4.2, and it gave 
rubbish when I used setNodeValue().

After considering all these facts I think it's better to keep XML generation in 
this way and just handle those special character occurrences.

I'm not reluctant to change the code if you have other ideas, I just wanted to 
say what I feel :).

Thanks.



> Plan exporter tool produces broken output if query contains less-than operator
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-4903
>                 URL: https://issues.apache.org/jira/browse/DERBY-4903
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.7.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: C.S. Nirmal J. Fernando
>         Attachments: derby-4903-a.diff
>
>
> The plan exporter tool fails to produce well-formed output for the following 
> query:
> ij> select * from sysibm.sysdummy1 where ibmreqd < 'Z';
> The generation of XML doesn't fail, but when I open the file in Firefox, I 
> see this message:
> XML Parsing Error: not well-formed
> Location: file:///tmp/plan.xml
> Line Number 9, Column 11:
> Operator: <
> ----------^
> HTML generation prints the following error, and produces an empty file:
> ERROR:  'The value of attribute "scan_qualifiers" associated with an element 
> type "null" must not contain the '<' character.'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to