Le 26/10/2014 03:18, Bruce Dubbs a écrit :
> Alan Feuerbacher wrote:
>> On 10/25/2014 9:16 PM, Bruce Dubbs wrote:
>>> Simon Geard wrote:
>>>> On Sat, 2014-10-25 at 17:58 -0400, Alan Feuerbacher wrote:
>>>>> I'm wondering if using this tool is the right way to test XML code. Do
>>>>> you LFS guys have any suggestions?
>>>>
>>>> What do you mean "test" XML code?
>>>
>>> About the only thing I know is xmllint.
>>
>> Ok, I see I have quite a bit more reading to do. :-)
> 
> Actually XML is fairly easy.  It's just tags and attributes.  The problem is
> that it's meaningless without a DTD (for example DocBook) and creating that is
> definitely non-trivial.
> 
> If you have a published DTD, then you can use xml tools like xmllint and
> xsltproc to actually do something.  There are other ways to parse xml too.  In
> Qt, they have a class that will parse xml and you can do something with that.
> 
> html is a subset of xml.
> 
> xsl on the other hand is just weird.
> 
>   -- Bruce
> 

xml by itself is fairly simple, but as already told, it is useless without a
DTD. It gives a general specification for writing markup formatted documents.
There are two levels of specification:
- well formed documents: documents which respect only the writing rules, like
the overall structure of the document (specially the header), the nesting of
tags and the use of entities.
- valid documents: they must be well formed and must satisfy a set of rules
known as a DTD (document type definition), which is itself included or
referenced inside a "DOCTYPE" instruction at the beginning of the document.

The question is whether you have a tool for verifying well-formedness and to
validate. Since I do not know the tool your book is referencing, I cannot tell
how to replace it. If you are not reluctant to use command line, xmllint is a
good tool, for both type of verifications. As an editor, vim is good at
highlighting XML code.

Now, what you should be aware of is that the hard part is outside XML: it is
in the purpose of the XML document itself. As you know, XHTML, HTML5 and
docbook documents are XML documents, but with a completely different set of
rules when it comes to use them. And XML can be used for completely different
purposes: small databases, configuration files (see the D-Bus configuration in
the book), and so on.

Pierre
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to