[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] smorgasbord of simple questions (well, three)
- From: Michael Kay <mike@saxonica.com>
- To: xml-dev@lists.xml.org
- Date: Mon, 08 Nov 2010 09:12:30 +0000
> 1.) if an undeclared namespace is utilized, is that document still
> well-formed? valid? I think it would be still be well formed because
> the tags and nodes still match, but invalid because...not sure on
> that.
The document is well-formed but not namespace-well-formed. These days
nearly everyone requires documents to be namespace-well-formed.
>
> 2.)
> from wikipedia:
>
> Attribute
> A markup construct consisting of a name/value pair that exists within
> a start-tag or empty-element tag. In the example (below) the element
> img has two attributes, src and alt:<img src="madonna.jpg"
> alt='Foligno Madonna, by Raphael'/>. Another example would be<step
> number="3">Connect A to B.</step> where the name of the attribute is
> "number" and the value is "3".
>
> what is the string “connect A to B”, if not a value of the attribute?
It is the value of the step element. It has no relationship to any XML
attribute. Perhaps your confusion is because often people use XML
elements to represent things that they think of as real-world
attributes, like the price of a book.
> 3.) how do you know whether the UTF-8 (or whatever) encoding is
> correct? I'm thinking of:
>
> "What if you have a document that has an encoding declared but is
> really stored in another encoding? Such is the case with the file
> oops.xml, which looks identical to time.xml but is stored as UTF-16
> even though the encoding declaration says UTF-8."
>
If the encoding specified in the header isn't the actual encoding,
expect parse errors when reading the file. It's your job to ensure this
doesn't happen.
Michael Kay
Saxonica
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]