XML Comments Bug

hey fellas
I have almost wrapped up my project except for one stupid bug that am getting. I'm using Oracle XML parser for Java.9.0
I am trying to add some xml comments in the output .xml file but it is giving trouble.
My code:
====
Comment comment =xmldocument.createComment("mary had a lazy lamb");
xmldocument.appendNode(comment);
=====
Now comments are being added in the output xml file. BUT GUESS WHAT, Instead of putting the string like a usual comment in xml like -
<!-- mary had a lazy lamb -->
It is putting it like -
<?#comment mary had a lazy lamb comments?> (exact code)
This, inadverantly throws an error when I open the file using a browser.
How to over come this.
Thanks

Hi Francine
Thanks for the response.
I am extremely sorry for writting incorrect code in my original post but I am using
=======
xmldocument.appendChild(comment);
========
and not appendNode(comment);
The program works fine and shows no error at run time.
But the output file that is generated [using transform] shows the xml comment code as -
<?#comment comments comments?> (exact code)
and not as desired -
<!-- comments -->
It would be great if you can test and suggest something.
Earlier I started with Crimson parser, then shifted to Xerces and finally to ODK XML parser. Both Crimson and Xerces give comment as desired but ODK API is giving the above undesired comment which cannot be interpreted correctly by the web browser. [ODK is preferable 'cuz of its superior processing speed].
Thanks once again and anticipating a positive response from you.

Similar Messages

  • [svn] 4128: Fix for - Examples imported by the @ includeExample tag are truncated after the first or second XML comment

    Revision: 4128
    Author: [email protected]
    Date: 2008-11-17 12:53:34 -0800 (Mon, 17 Nov 2008)
    Log Message:
    Fix for - Examples imported by the @includeExample tag are truncated after the first or second XML comment
    examples-path option is now public and adding period at the end of Constructor.
    QE Notes: baselines need to be updated.
    Doc Notes: None
    Bugs: SDK-18125, SDK-18077, SDK-18126
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18125
    http://bugs.adobe.com/jira/browse/SDK-18077
    http://bugs.adobe.com/jira/browse/SDK-18126
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/ASDocConfiguration.java

    I have the same problem except almost every song I bought from Itunes has this problem. Not only that, but somehow some of the music, about $125 worth has been deleted form my 3 back up discs. This is only happening with my purchases and not any songs I uploaded from cd. How on earth did this happen, and how did it wipe clean 3 different back ups? I have found some of the music where it belongs, but like I said some of them are gone, gone, gone. I run three different back ups and they are on 24/7. Where is all of this music? I still have it on my ipod, but it will not load back into itunes the way purchases used to. Some of the music is purchased straight to my ipod touch, but shouldn't i be able to reload them into itunes? I spent 3 hours going 1 song at a time reloading them from their original location. But I cannot locate about $125 worth of music that I purchased from itunes. I have 6 macs in my family and preach the good news to all who will listen about hows macs are flawless. Now I have egg all over my face and have thrown away a nice sum of money on missing music. Please help!

  • XML Comments in SOAP message - jax-rpc

    I ran across an issue with comments in my soap messages with regards to the serialization.
    My solution was to strip all the comments inbound and outbound.
    Are xml comments supported by JAX-RPC? I am currently scouring the internet for more information, but the closest I have come is a reference in the IBM implementation which doesn't really help me out.
    Any thoughts are appreciated.

    I'm trying to figure this out myself. I am using JAXM to access a web service but it wants the xml version...

  • XML Comment in Indesign using Apple script.

    Hi all,
    How to find the selected XML element is commented in indesign and get XML comment value in thru apple script. Any Ideas?
    -Jacintha

    You can have as many comments as you want so they require you to state the index of the comment in your reference.
    Assuming you have an object reference for the XML element, you would replace "associated XML element of selection" with that.
    tell application "Adobe InDesign CS3"   
        set myComments to {}
        if every XML comment of associated XML element of selection is not {} then
            set end of myComments to value of every XML comment of associated XML element of selection
        end if
        return myComments
    end tell
    if you know there's only going to be one comment then,
    tell application "Adobe InDesign CS3"
        if every XML comment of associated XML element of selection is not {} then
            set  myComment to value of XML comment 1 of associated XML element of selection
        end if
        return myComment
    end tell
    ~Mike

  • xml:comment with BEA 6.1 sp1

    Hello,
    I have migrated a small project from BEA WLS6.0 to WSL6.1 with sp1. This project
    use the BEA taglib to transform XML data into HTML due an XSL stylesheet.
    My problem is that with the new version of the Xalan XSLT (WLS6.1), the XSL tag
    <xml:comment> does not generate a HTML comment anymore, however it worked fine
    in the previous version.
    Could somebody help me or give me more information ? Thanks.
    Sebastien

    Hello,
    I have migrated a small project from BEA WLS6.0 to WSL6.1 with sp1. This project
    use the BEA taglib to transform XML data into HTML due an XSL stylesheet.
    My problem is that with the new version of the Xalan XSLT (WLS6.1), the XSL tag
    <xml:comment> does not generate a HTML comment anymore, however it worked fine
    in the previous version.
    Could somebody help me or give me more information ? Thanks.
    Sebastien

  • How to preserve XML comments in indesign cs4 document

    Hi,
    I have the below table xml with me:
    <?xml version="1.0" encoding="UTF-8"?>
    <informaltable xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid5:tablestyle="UNTABLE" aid:trows="4" aid:tcols="2" float="0">
    <!--tgroup aid:table="table" aid5:tablestyle="UNTABLE" aid:trows="24" cols="2" colsep="0" rowsep="0" align="left"--><!--colspec colnum="1" colname="c1" align="left" colwidth="25"/--><!--colspec colnum="2" colname="c2" align="left" colwidth="25"/--><!--thead--><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_H1">Chronology:</para></Cell><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_H1">14,000 Years Ago to 1590 c.e.</para></Cell>
    <!--/thead--><!--tbody--><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL"><emphasis aid:cstyle="BOLD" role="strong">14,000 years ago</emphasis></para></Cell><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL">Early Paleo-Indians in Florida and Pennsylvania regions, and also in Monte Verde, Chile.</para></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL"><emphasis aid:cstyle="BOLD" role="strong">13,900 to 12,900</emphasis></para></Cell><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL">Clovis hunters spread</para></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL"><emphasis aid:cstyle="BOLD" role="strong">years ago</emphasis></para></Cell><Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="129" valign="top"><para aid:pstyle="CR_UNTBL">across North America.</para></Cell>
    <!--/tbody--><!--/tgroup--></informaltable>
    I am able to import this xml in to indeisgn document successfully. But when I export the same table out of Indesign, the xml comment  <!--tgroup... is not exported.
    Is there any method to preserve the comment on export. Please suggest a solution for this.
    Thanks,
    Gopal

    You must include the comment() as one of the elements that you select to process.
    It is best to use xsl:value-of or xsl:copy-of with select="informaltable/comment()" to avoid processing comments from other parts of your XML file. In other words, always make the processing of comment() specific to the location where you need to extract the content of the comment.

  • Xpath to find a xml comment

    What is the xpath syntax to find all xml comments?

    Yes that did it.
    No idea why I couldn't find it before on the w3.org xpath reference. Just jumps out at me now.

  • How to extract xml comments

    Hi,
    I have loaded XML files into my table of XML Type . I have comments in XML file. This comments are important to us and I want to extract this comments . How can we extract the comments present in XML file. I was not able to find any function which can do it.
    Thanks,
    Ramesh.

    Hi Ramesh,
    First of all, instead of posting three times in different forums, why not provide relevant details such as database version and a sample XML?
    Generally, XML comments are not meant to be extracted.
    If they contain so important data then most likely that data should be stored in regular element or attribute nodes.
    Here's an example using XQuery though :
    SQL> create table tmp_xml of xmltype;
    Table created
    SQL>
    SQL> insert into tmp_xml values (
      2   xmltype('<root>
      3  <!-- this is a comment -->
      4  <item/>
      5  <!-- this is another comment -->
      6  </root>')
      7  );
    1 row inserted
    SQL>
    SQL> select x.comment_text
      2  from tmp_xml t
      3     , xmltable(
      4         '/descendant::comment()'
      5         passing t.object_value
      6         columns comment_text varchar2(200) path '.'
      7       ) x
      8  ;
    COMMENT_TEXT
    this is a comment
    this is another comment

  • Problem with Regular Expression: XML comment parsing

    I have create pattern to parse xml comments:
    <!--(?!.*(<!--)).*-->It works fine but only problem that I have is that it parse only last occurrence :(

    sabre150 wrote:
    MrJbee wrote:
    I have create pattern to parse xml comments:
    <!--(?!.*(<!--)).*-->It works fineI'm surprised it works fine since the ".*" is greedy and will gobble as much as it can and you will end up matching from the start of the first comment to the end of the last comment.
    but only problem that I have is that it parse only last occurrence :(Make the ".*" reluctant using ".*?" or, best of all, use an XML parser.
    Edited by: sabre150 on Jan 11, 2010 4:00 PMFirst at thanks for reply.
    Second it is not so greedy like it look. Because of that:
    (?!.*(<!--))I can`t use xml parser since It is only part of my JEditor with styles. I use reg exp to highlight comments, strings, chars and so on....
    By the way I try to replace .* => .*? and it is still no results. I mean only last is selected. Maybe you have an example on how to match structure if the do not
    have specified substrings.
    Something like this:
    hello[^(guten tag)]*bye // I know that this is wrongEdited by: MrJbee on Jan 11, 2010 1:22 PM

  • Oracle XML Parser - "comments"  BUG!

    hey fellas
    I have almost wrapped up my project except for one stupid bug
    that am getting. I'm using Oracle XML parser for Java.9.0
    I am adding some comments in the output xml file but it is giving trouble.
    My code:
    ====
    Comment comment =xmldocument.createComment("mary had a lazy lamb");
    xmldocument.appendNode(comment);
    =====
    Now comments are being added in the output xml file. BUT GUESS what -
    Instead of putting the string like -
    <!-- mary had a lazy lamb -->
    It is putting it like -
    <?#comment mary had a lazy lamb comments?>
    This, inadverantly throws an error when I open the file using a browser.
    How to over come this.
    Thanks

    Hey fellas I urgently need a response!!Long-term solution: report it to Oracle as a bug.
    Short-term solutions: don't write comments to your document. Or try a different serializer.

  • XML-comments not allowed in IDOC_AAE-Adapter?

    Hi,
    we have a File to IDOC scenario and are using the IDOC_AAE adapter for sending IDOCs to the SAP system.
    In our mapping we have added some comments into the XML-IDOC-structure.
    By sending the document to the SAP-system we are getting the following error:
    MP: exception caught with cause
    com.sap.aii.af.idoc.exception.IDOCAdapterException: Error before sending due to
    idoc parsing error: (7) IDOC_ERROR_PARSE_FAILURE: Invalid XML 1.0 character
    encountered within IDocXML for type <INVOIC01>:
    state=READING_FIELD_STARTTAG, charPosition=872, lineNumber=23, columnNumber=14,
    invalidChar=U+0021,
    sourceSnippet=...RCY>^~~~<KUNDEUINR>DEXXXXXXX</KUNDEUINR>^~~~<BSART>INVO</BSART>^~~~<!--
    ZIM_IDOC_RBU_HEAD_S -->^~~... ^
    The problem seems to be the <!-- - Tag in the structure.
    But the ! (U+0021) is a correct XML 1.0 character. I don't know why the IDOC-XML parser throws this exception.
    Does anybody have an idea what the problem is?
    When we remove the comments the IDOC could be sent successfully to the SAP system.
    Are only IDOC-specific characters allowed here, no comments and no other XML-specific characters and structures?
    This would be very strange.
    Thanks for your answer.
    Regards
    Thorsten

    Hi Anoop / Ilayarajan,
    Could you please post the solution for this error. When I provision a user to PeopleSoft, I am getting similar error: com.waveset.util.WavesetException: An error occurred adding user "userID' to resource 'PeopleSoft Component Interface'. com.waveset.util.XmlParseException: XML Error: 1:1: Content is not allowed in prolog.
    Thanks
    User_idm

  • How to remove Reports Default XML Comment

    We have a report (Oracle Reports 10.1.2.0.2).
    And in the report the following Comment line is generated.
    <!-- Generated by Oracle Reports version 10.1.2.0.2 -->
    Is there a way to eliminate this line?
    this is important because some governmental organisations cannot process an XML with this comment in it.

    You can use different first page property, and remove it from other pages.

  • Parsing String to XML Attribute bug

    Hello!
    I'm trying to convert String to org.w3c.dom.Document with javax.xml.parsers.DocumentBuilder, but when I check my XML Document after creating, I find that all the Attributes are like "" or "&#xa; ". Does anyone have some idea why that problem is and how it can be solved?
    Thanks a lot!
    Svigi

    There are lots of bug reports about Java 5's built-in XML parser screwing up on attribute values. Try forcing Java to use the current version of Xerces (download it) instead of whatever it has built in, if that seems to apply to you. On the other hand it's possible that the bug is in your code too.

  • Ejb-jar.xml generation bug?

    Hi,
    I noticed that TopLink seems to forget the tag <primkey-field> and put java.lang.Object instead of Integer in the tag <prim-key-class>?
    Is this an error from me?
    Vlad

    Hi,
    For a JEE5 EJB module, rather than using EJBGen, you can use WLS specific annotations for configuring common settings. If you follow the link below, you can see a list of supported EJB annotations. Disregard the fact that the documentation section title is WebLogic Kodo Annotations. That is incorrect and I've filed a bug for it.
    http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1438036.
    Unfortunately, we don't yet support setting all weblogic-ejb-jar.xml configuration values via annoations so in some cases a weblogic-ejb-jar.xml is still required.
    You can hand edit your weblogic-ejb-jar.xml and the example you posted below should work fine.
    - Matt

  • XML Comment

    hi all, if i want to add a comment to a dom, do i have to do this through adding a text node to an element, i.e document.createTextNode("<!--" + commentstring + "-->");or is there a way to explicitly add a comment to an xml element in the java api?
    many thanks!

    gosh damn it, found it in the api, i dont know how i missed it (tired), sorry again

Maybe you are looking for

  • Component video to S-video adapter?

    I'm trying to hook up my Apple TV to a switcher that takes S-video. I can't seem to find an adapter for this, anybody know of one? thanks!

  • TDS Certificate related to ADVANCE Payment

    Hi I Senario I posted advance of Rs 7000 aganist Vendor and  i posted invoice for Rs 15000 and cleared through F-54 then generated chalan. upto chalan the amount is correct.But when i generate Ceritficate i am getting two certificates generated 1. Ce

  • 5800 gps not working..

    whats the meaning of this massage? the standard gps features have been disabled in accordance with market regulations. Solved! Go to Solution.

  • Sound stops during games

    Randomly my sounds stops during most of my games.  Clash of clans my sound will fade in and out like its trying to work properly, but other apps are just muted completely.  If im listening to music while playing a game, it seems to happen more often.

  • REF:SMARTFORM OUTPU TTYPE

    HI ALL, CAN ANYBODY TELL ME WHAT R THE OUTPUT TYPES FOR THESE APPLICATIONS. 1.INVOICE 2.AR MEMO CHARGESHEET 3.PRELIMINARY NOTICE 4.CONDITIONAL WAIVER AND RELEASE UPON PROGRESS PAYMENT. THESE R RELEATED TO FICO. THANKS & REGARDS, PHANI.