Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saveXml creates empty tags in short notation except for empty strings #11

Closed
jami opened this issue May 10, 2012 · 1 comment
Closed
Assignees
Labels
Projects
Milestone

Comments

@jami
Copy link

jami commented May 10, 2012

Hi,

CFType creates empty tags in short notation, which is very useful. But it does not work for empty strings.

For empty strings we got which should be
I have a little patch for you that might fix this issue.

Here is the patch for CFType.php:62

/**

  • Get XML-Node.

  • @param DOMDocument $doc DOMDocument to create DOMNode in

  • @param string $nodeName Name of element to create

  • @return DOMNode Node created based on CType

  • @uses $value as nodeValue
    */
    public function toXML(DOMDocument $doc, $nodeName) {
    $node = $doc->createElement($nodeName);

    if ('' != $this->value) {
    $text = $doc->createTextNode($this->value);
    $node->appendChild($text);
    }
    return $node;
    }

ckruse added a commit that referenced this issue Jul 22, 2012
@ckruse
Copy link
Collaborator

ckruse commented Jul 22, 2012

Fixed in commit d0e9451

@ckruse ckruse closed this as completed Jul 22, 2012
@ajsb85 ajsb85 added the bug label Apr 18, 2018
@ajsb85 ajsb85 added this to Done in Package Apr 18, 2018
@ajsb85 ajsb85 added this to the 2.0 milestone Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Package
  
Done
Development

No branches or pull requests

5 participants