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

NamespaceBuilder does not add namespace declaration to the generated xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.4
    • None
    • XML Processing
    • 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

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

            Dates

              Created:
              Updated: