Re: XmlFormatter: space isn't allowed in xml tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi, i have a try with lxml. It couldn't be decoded.

In [8]: etree.XML("<OpHistory><num to keep>20</num to keep><duration
to keep>600</duration to keep><Ops></Ops></OpHistory>")
  File "<string>", line 1
XMLSyntaxError: Specification mandate value for attribute to, line 1, column 20


It's OK without spaces.

In [6]: etree.XML("<OpHistory><num>20</num><Ops></Ops><?OpHistory>")
  File "<string>", line 1
XMLSyntaxError: ParsePI: PI OpHistory space expected, line 1, column 47

2017-01-12 18:34 GMT+08:00 John Spray <jspray@xxxxxxxxxx>:
> On Thu, Jan 12, 2017 at 6:15 AM, liuchang0812 <liuchang0812@xxxxxxxxx> wrote:
>> sorry, Our XMLFormatter has this feature, but lowercased_underscored
>> is false default.
>>
>>
>> XMLFormatter(bool pretty = false, bool lowercased_underscored = false);
>
> I see this was added in this commit:
> commit 4ea0c7c65d9e627acb73524afdc7f51ac02aa25d
> Author: Radoslaw Zarzynski <rzarzynski@xxxxxxxxxxxx>
> Date:   Thu Oct 22 18:56:14 2015 +0200
>
>     rgw: XMLFormatter may print XML tags lowercased and underscored now.
>
>
> ...but I can't see why the parameter was ever optional -- I think we
> should just always do this transformation?
>
> John
>
>
>>
>> 2017-01-12 13:27 GMT+08:00 liuchang0812 <liuchang0812@xxxxxxxxx>:
>>> hi, all
>>>
>>> an XML tag cannot contains space in it. see
>>> https://www.w3.org/TR/2008/REC-xml-20081126/#NT-NameChar.
>>>
>>> Ceph uses `xmlformatter` to dump XML text, and there are a lot of
>>> space in xml tag currently. so, need we fix this?
>>>
>>> We could fix this as :
>>> 1. simple solution: replace `space` with `_`
>>> 2. urlencode: \n = &#xA; \r = &#xD; \t = &#x9; space = &#x20;
>>>
>>> any comments are appreciated!
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux