Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Banned
    Join Date
    Jan 2004
    Location
    Minneapolis, MN
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Strings and XHTML Validation

    If the ampersand character will invalidate my XHTML documents, how am I supposed to pass query strings with multiple variables along with certain links?

  • #2
    New Coder
    Join Date
    Dec 2003
    Location
    California
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    &
    // freak

  • #3
    Banned
    Join Date
    Jan 2004
    Location
    Minneapolis, MN
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah.. dur..



    thanks.

  • #4
    Banned
    Join Date
    Jan 2004
    Location
    Minneapolis, MN
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that's fairly annoying though. is there a really good reason i'm ignorant of for this?

    i mean, i was already using the "&" before, and now for "valid" markup i'm going to have to get used to a simple, but tediously annoying extra four characters everytime i wanna pass some freakin' variables?

    geez..

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Yes, it's because & has been reserved for entity references the whole time, but XML is stricter in how you are allowed to use it. In other words, XML will not allow you to use & for anything other than an entity reference, while SGML was laxer and only parsed them as entity references when they were obviously a part of an entity reference.

    XML has a few quirks like that. It's not intended to be a more space efficient language than SGML - it's indented to be a less ambigous language than SGML.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #6
    Banned
    Join Date
    Jan 2004
    Location
    Minneapolis, MN
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yeah, but i just think that's one exception that could reasonably be made at least. just in that one instance, where an & is deteceted in an anchor's href attribute. 'cause as i said, it just seems needlessly excessive to require it there. i guess i'm just being a whiney *****, but.. *shrug*

    but yeknow, i was just thinking about it, and it would actually be beneficial at making href's with longer query strings easier to read. (the ;'s)

    so meh.. guess i'll just get used to is

  • #7
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    But, you know, from an XML point of view, an attribute named href is no different from an attribute named id or an attribute named boo. XML doesn't give any specific element, attribute or entity name any special treatment compared to the others - all are equal (Well, with the exception of anything that starts with xml, since that means it's from one of the additional XML specs, such as the 'xmlns' for XML namespaces).

    One of the reasons XML is a preferred language to SGML is just that there are no special cases. Another is that nothing may be minimised. Yet another is that you must explicitly close an element, because if you don't give the element name any specific properties, how do you know if the element is intended to be empty or contain content?
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #8
    Banned
    Join Date
    Jan 2004
    Location
    Minneapolis, MN
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so, to switch topics a bit, is XML in its simplest form just a set of very specifics and semantic tags designed to more accurately describe their content? no scripts, fancy functions, etc? and then CSS (or XSL i guess, though i know next to nothing about it) is used for presentation?

    i feel like i have a decent, VAGUE grasp on XML, but i wouldn't know how to implement it, when it's warranted for sure, etc.

    can you offer any insights, links, etc? the W3C is too dry and technical, and i've not found many tutorials that say anything other than "XML is a metalanguage, a language for describing languages, blah blah blah." Show me it in action! Explain what and why! Bah!

  • #9
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Ok, I'll try to explain it in plain English, if I can. Let's start with describing what XML is not, however, since the confusion generally is that people think of XML as something it isn't - namely an end document language.


    - XML does not have any elements or attributes*.
    - XML does not have any semantical meaning.
    - XML does not have any presentational or rendering properties whatsoever.
    - XML does not have any behavior or functionality properties whatsoever.

    * Well, when it goes for attributes, it has. More on that later.

    Ok, then when I say that, I might have to explain what XML really is, right? OH well:

    - XML is a set of syntax rules for markup. These describe the usage of tags for creating PIs*, comments, notations, and elements. It also describes the usage of entities and entity references, as well as attributes on elements.
    - XML describes how an XML application** encodes a document structure with tags.
    - XML defines what characters are allowed in tags and entities.
    - XML defines mechanisms for describing what XML application a docuemnt is written in.

    * PI is an abbreviation for processing instruction.
    ** An XML application is an XML markup language, for example RSS, Atom, XHTML, XSL-FO, SVG, MathML.


    So, what is an XML application?
    - And XML application is a markup language described as XML.
    - An XML application provides a set of elements, describing element names, their allowed contents, and their attributes, as well as entities, in the form of either a DTD*, an XML Schema or a RelaxNG document.
    - An XML application may have default behaviors and functionality as well as presentational and rendering properties associated with it through either DOCTYPE recognition, namespace recognition, metadata recognition (outside the scope of XML), or proprietary recognition mechanisms.
    - And XML application may provide semantics through the specification for the language, through readable and meaningful names on elements and attributes,

    * DTD meaning Document Type Definition, not to be confused with DOCTYPE, Document Type Declaration, which only describes which DTD to use.


    And, finally, what is an XML document?
    - An XML document is a document conforming to the conforming to XML well formedness and the XML syntax rules.
    - An XML document may, or may not, be written according to an XML application.
    - If so, it may describe what XML application or applications it conforms to through DOCTYPE, XML Schema, XML Namespace, or metadata recognition.
    - An XML document is valid if it not only conforms to the XML syntax and well formedness rules, but also to the validation method (DTD, XML Schema, RelaxNG) and the additional restrictions both XML and the XML application puts on it when validating. Some of these restrictions may not be evident from the validation method, and only be described in the specification itself.




    There are some special cases, though. XLink, XML Events, XForms, XInclude, XFrames may be considered XML applications but are really extensions of XML. There are also a few default attribute names and namespaces in XML, these being xml:*, xml:space, xml:lang, xml:base, xmlns, xmlns:*. Attribute and element names may not begin with /[xX][mM][lL]/ unless they are part of an XML specification or extension.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    Stillwater Ok
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    .....wow.....

    liorean, you get the terse award for the week.
    "Never offend people with style when you can offend them with substance."
    --Sam Brown

  • #11
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Somehow, I can't say if that was an ironic comment or not.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #12
    giz
    giz is offline
    Regular Coder
    Join Date
    Apr 2003
    Location
    UK
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, good post. Interesting. Useful.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •