[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: smorgasbord of simple questions (well, three)

  • From: David Carlisle <davidc@nag.co.uk>
  • To: Thufir <hawat.thufir@gmail.com>
  • Date: Mon, 08 Nov 2010 02:04:55 +0000

Re:  smorgasbord of simple questions (well
On 08/11/2010 01:31, Thufir wrote:
> If I may, I'd like to pose three, I think, fairly simply but unrelated
> questions:
>
>
> 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.
>

Formally it's well formed but not namespace well formed (a term 
introduced by the namespaces rec). It may or may not be valid (depending 
on the dtd).  If your parser is namespace aware it's likely to be 
rejected with a fatal error as it''s not namespace well formed.

http://www.w3.org/TR/REC-xml-names/#dt-nwf

>
> 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?

The content of the element step.

> All this is happening within the step node?

The XML Recommendation itself only concerns itself with the surface 
syntax and not any internal node model.


>
>
> 3.) how do you know whether the UTF-8 (or whatever) encoding is
> correct?  I'm thinking of:

there are tools that can check encodings (this isn't really an xml 
question) there is an appendix in the XML ReC that describes how a 
systen should detect the encoding if it's not declared.
>
> "What if you have a document that has an encoding declared but is
> really stored in another encoding?

in most cases this will lead to a fatal error.

  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 it is served over HTTP and the HTTP heders specify the correct 
encoding these will be taken in preference to the encoding specified in 
the file, in which case the file may work, other wise it's an error.

>
> http://etutorials.org/XML/xml+hacks/Chapter+2.+Creating+XML+Documents/Hack+27+Encode+XML+Documents/
>
> I never really thought about whether my files were in any particular
> format.  How do you ensure this on a regular basis?  using HTML tidy
> on every file seems a bit absurd.
>
>
>
> thanks,
>
> Thufir

David


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.