SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can XHTML support user defined tags?

    Hi

    I am new to use XHTML.

    We have in our project some output which suppost to embed into XHTML,
    Something like this.

    <div id="xxx" class="yyy">
    <UserDefinedtag1 a="5834" b="855" result="0">
    <UserDefinedtag2 a="5834" b="855" result="0"/>
    <UserDefinedtag2 a="5844" b="853" result="0"/>
    </UserDefinedtag1>
    </div>

    does XHTML support user defined tags?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you can supply your own DTD and make it validate, but no browser will understand the semantics of those tags.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks AutisticCuckoo,

    Is that mean XHTML does not support user defined tag in normal condition?
    The only difference btween HTML and XHTML is well-formed tags.
    What is meant by EXtensible in XHTML(EXtensible HyperText Markup Language) ?

  4. #4
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Best thing is probably to use XSLT to tranform it into XHTML. You can make up your own tags as AutisticCuckoo said, but nothing will happen with them as the browser won't know what to do with them. They won't be displayed.

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by mitra4umohit
    Thanks AutisticCuckoo,

    Is that mean XHTML does not support user defined tag in normal condition?
    The only difference btween HTML and XHTML is well-formed tags.
    What is meant by EXtensible in XHTML(EXtensible HyperText Markup Language) ?
    XHTML does allow extensibility, but a browser has no idea what to do with a tag that you just made up. Your element will have no semantics that the browser knows of and can assign any importance to.

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mitra4umohit
    The only difference btween HTML and XHTML is well-formed tags.
    Not really. It's rather more complicated than that.

    You can extend XHTML, but you need to write a plug-in for all browser to make any sort of semantic sense of it, like people have done for some extensions (SVG, MathML, ...).

    Extensibility is not as useful as one might like to believe.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for such quick reply Stormrider,

    I jst got one more problem in id attribute for component while validating xhtml.
    my
    id="links/user_links?ID=5834&amp;sessionID=A2ED57A34E438F0C6"

    it give character "/" is not allowed in the value of attribute "id".
    So is there any limitation or criteria on id value?

  8. #8
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think ID can only be alphanumeric, but I'm not sure on the requirements for this... anyone else?

  9. #9
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    4.1.3 Characters and cases
    In CSS 2.1, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [A-Za-z0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, or a hyphen followed by a digit. Only properties, values, units, pseudo-classes, pseudo-elements, and at-rules may start with a hyphen (-); other identifiers (e.g. element names, classes, or IDs) may not. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".

  10. #10
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Karinne,

    I am still not clear about id.
    XHTML attribute 'id' is anywhere related to CSS2.1 specification?
    do we have any such W3C draft for XHTML attributes?

  11. #11
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mitra4umohit
    Thanks Karinne,

    I am still not clear about id.
    XHTML attribute 'id' is anywhere related to CSS2.1 specification?
    do we have any such W3C draft for XHTML attributes?
    ah yes ... we're talking regular ID here ... it's still the same more-or-less

    ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
    from http://www.w3.org/TR/html4/struct/global.html#adef-id and clicking on name you get to http://www.w3.org/TR/html4/types.html#type-name

    And here are the differences between XHTML and HTML

  12. #12
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Karinne

  13. #13
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem ... glad I could help.


Bookmarks

Posting Permissions

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