[augeas-devel] [Augeas] #257: RFE: XML lens should be line-ending independent

Augeas trac at fedorahosted.org
Fri Feb 17 13:41:17 UTC 2012


#257: RFE: XML lens should be line-ending independent
-------------------------+---------------------
 Reporter:  biltong      |       Owner:  lutter
     Type:  enhancement  |      Status:  new
 Priority:  major        |   Milestone:  next
Component:  Augeas       |     Version:  0.10.0
 Keywords:               |  Blocked By:
 Blocking:               |
-------------------------+---------------------
 Please could augeas support all line-endings for XML files?

 Below is an example that fails due to Windows line-endings. Note that
 xmlstar reports the file as valid.

 $ cat /tmp/web.xml
 <?xml version="1.0" encoding="ISO-8859-1"?>

 <!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd";>

 <web-app>
   <display-name>Tomcat Documentation</display-name>
   <description>
      Tomcat Documentation.
   </description>
 </web-app>

 $ xmlstarlet val /tmp/web.xml
 /tmp/web.xml - valid

 $ augtool
 augtool> set /augeas/load/xml/lens "Xml.lns"
 augtool> set /augeas/load/xml/incl /tmp/web.xml
 augtool> load

 augtool> print /augeas/files/tmp/web.xml/error
 /augeas/files/tmp/web.xml/error = "parse_failed"
 /augeas/files/tmp/web.xml/error/pos = "43"
 /augeas/files/tmp/web.xml/error/line = "1"
 /augeas/files/tmp/web.xml/error/char = "43"
 /augeas/files/tmp/web.xml/error/lens =
 "/usr/share/augeas/lenses/dist/xml.aug:133.10-135.60:"
 /augeas/files/tmp/web.xml/error/message = "Syntax error"

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/257>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list