You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Nasir Hussain (JIRA)" <xe...@xml.apache.org> on 2013/01/30 14:09:12 UTC

[jira] [Commented] (XERCESJ-1602) Iframe element is serialized incorrectly

    [ https://issues.apache.org/jira/browse/XERCESJ-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13566450#comment-13566450 ] 

Nasir Hussain commented on XERCESJ-1602:
----------------------------------------

The problem occurs in this part of code in the else part, there should be a check for iframe tag and for this case proper closing '</iframe>' should be done.

{code}
  // If element has children, then serialize them, otherwise
        // serialize en empty tag.        
        if (elem.hasChildNodes()) {
            // Enter an element state, and serialize the children
            // one by one. Finally, end the element.
            state = enterElementState( null, null, tagName, fPreserveSpace );
            state.doCData = _format.isCDataElement( tagName );
            state.unescaped = _format.isNonEscapingElement( tagName );
            child = elem.getFirstChild();
            while (child != null) {
                serializeNode( child );
                child = child.getNextSibling();
            }
            if (fNamespaces) {
                fNSBinder.popContext();
            }
            endElementIO( null, null, tagName );
        } else {
            if (DEBUG) {
                System.out.println("==>endElement: " +elem.getNodeName());
            }
            if (fNamespaces) {
                fNSBinder.popContext();
            }
            _printer.unindent();
            _printer.printText( "/>" );
            // After element but parent element is no longer empty.
            state.afterElement = true;
            state.afterComment = false;
            state.empty = false;
            if (isDocumentState())
                _printer.flush();
        }
{code}
                
> Iframe element is serialized incorrectly
> ----------------------------------------
>
>                 Key: XERCESJ-1602
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1602
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.11.0
>         Environment: java version "1.6.0_24"
> Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
> Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
>            Reporter: Nasir Hussain
>            Priority: Critical
>         Attachments: XercesTest.java
>
>
> when we try to serialize iframe element such as <iframe frameborder="0" height="250" src="http://www.youtube.com/embed/w2CsEUn4ZuU" width="418"></iframe>
> The serialized output is:
> <iframe  frameborder="0" height="250" src="http://www.youtube.com/embed/w2CsEUn4ZuU" width="418" />
> This is invalid html after serialization, iframe element must be closed using '</iframe>' tag not by '/>'
> The sample code for reproducing this problem is attached on the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org