BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


Schemas, xsd, xdr
Tips for Designing a DTD- Part 3 of 4 : Database Oriented Data
Tips for Designing a DTD- Part 4 of 4 : Object Oriented Data
Getting the value of an element with optional subelements
XML Code Generator: Generating Wrapper Classes from an XML Schema
What is WDDX?
XSLT Stylesheet for summarizing the structure of an XML document
Validating XML with Schemas
Punctuated Changes In XML Documents
XMLStarlet Command Line XML Toolkit
W2XML v2.0 SR1
Free DTD for Academic Publishers
Arquemie for XML Schemas
XMLStarlet Command Line XML/XSLT Toolkit
XSD Merger


 
 

<< reBloggerSEO >>


By Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First Posted 03/14/2002
Times viewed 1984

Tips for Designing a DTD- Part 2 of 4 : Semi-Structured Documents


Summary When creating semi-structured data and content-oriented documents, place human-readable text in elements, not attributes.

Elements vs. Attributes with Semi-Structured Documents

When creating semi-structured data and content-oriented documents, place human-readable text in elements, not attributes. This is because attributes are part of the structure, not the content.  If you can separate structure from content, you can extract content without tags while retaining the human-readable information.

Text within an element should be considered viewable.  Attribute values, on the other hand, are either invisible or rendered in some other way by a graphical object. Use attribute values to modify or further identify specific elements.

Examples,

<prompt type=boolean>Do you want the information?
    <choice value=true>Yes, please send the information</choice>
    <choice value=false>Don't send me the information</choice>
</prompt>

<photo width=x height=y src=URL alt=Text if photo not rendered or on mouse-over>
This is the caption for the photo.
</photo>

If you follow this rule, the value-of XSL tag or nodeValue property in the XML DOM (or text property in the Microsoft XML DOM) can easily recondition the content for publication on an unformatted device, as illustrated below.

This following XSL statement

<xsl:value-of select=photo/>

produces the following text:

This is the caption for the photo.

Excepts from XML Unlocks Information: How XML Accommodates Human-Authored Content

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< reBloggerSEO >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML