XML tagname starting with number is not working

前端 未结 3 1060
走了就别回头了
走了就别回头了 2020-12-17 18:39

I want to update the component 870Jars atrribute values using Jenkins build. When i open the xml file in IE, I am getting the below error

Error:- The XML page canno

相关标签:
3条回答
  • 2020-12-17 19:07

    An XML element whose name starts with a number is illegal XML. You should not start with numbers.

    XML elements must follow these naming rules:

    • Names can contain letters, numbers, and other characters
    • Names cannot start with a number or punctuation character
    • Names cannot start with the letters xml (or XML, or Xml, etc)
    • Names cannot contain spaces

    Any name can be used, no words are reserved.

    http://www.w3schools.com/xml/xml_elements.asp

    Specification Details.

    0 讨论(0)
  • 2020-12-17 19:08

    Simple workaround is to {concat('_',data(desired_tag_name_here))} and filter out the first character elsewhere if it is a lodash. A tidbit hacky, but when CData and other methods are either too dirty or make the code unreadable, just tag a note by the concatenation, fix it with the next handler, and move on about your business

    0 讨论(0)
  • 2020-12-17 19:09

    Try using a CDATA like below:

    <component>
        <![CDATA[    
        <870Jars>
        <filename>v10.3.0-870Jars.zip</filename> 
        <targetfilename/> 
        <version>v10.3.0</version> 
        </870Jars>
     ]]>
    </component>
    
    0 讨论(0)
提交回复
热议问题