Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7576

NamespaceBuilder does not add namespace declaration to the generated xml

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.4
    • Fix Version/s: None
    • Component/s: XML Processing
    • Labels:
      None

      Description

      The code bellow produces the same XSD, both without the xmlns:xs attribute. It was tested in groovy console today:
      https://groovyconsole.appspot.com/edit/5161363399770112

      import groovy.xml.MarkupBuilder
      import groovy.xml.NamespaceBuilder
      
      def writer  = new StringWriter()
      def builder = new MarkupBuilder(writer)
      def xsd     = new NamespaceBuilder(builder).namespace('http://www.w3.org/2001/XMLSchema', 'xs')
      
      xsd.schema() {}
      writer.toString()
      
      xsd.schema("xmlns:xs": 'http://www.w3.org/2001/XMLSchema') {}
      writer.toString()
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kovax Zsolt Kovacs
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: