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

RE: When to design an attribute in a namespace?

  • To: xml-dev@l...
  • Subject: RE: When to design an attribute in a namespace?
  • From: "Mayne, Peter" <PeterMayne@a...>
  • Date: Thu, 22 Apr 2004 11:02:59 +1000

xml namespace tal
Title: RE: When to design an attribute in a namespace?

> From: kynn@p...
> But I am interested in learning to recognize those rare situations
> in which, as a designer, one *should* put a particular attribute
> in a namespace.  This is still very unclear to me.  What are the
> requirements that an attribute must fulfill to be a good candidate
> for being placed in a namespace by the schema/DTD designer?

I'm not sure if this example is relevant, but it certainly has attributes in different namespaces.

Zope (http://zope.org/) uses the Template Attribute Language (TAL) in its page templates. Using TAL, Zope can transform a page template to the final XHTML.

For instance (I'm stretching things slightly here, and comments about suss XHTML will be ignored :-):

<html>
  <body>
    <p tal:repeat="row here/listWorkItems">
      Item ID: <span tal:replace="row/item_id"/>
      <br/>
      Task ID: <div tal:content="row/task_id">Content goes here</div>
    </p>
  </body>
</html>

The tal:repeat attribute specifies a loop using "row" as the loop variable and "here/listWorkItems" as the list to iterate over.

The tal:replace attribute causes the entire <span> element to be replaced with the specified item id.

The tal:content attribute causes "Content goes here" to be replaced with the specified task id, while leaving the <div> in place.

Just specifying "repeat", "replace", etc won't work, because these aren't acceptable XHTML attributes. Using attributes from a different namespace seems to fit the bill nicely.

PJDM
--
Peter Mayne
Technology Consultant
Spherion Technology Solutions
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602
T: 61 2 62689727  F: 61 2 62689777

 The information contained in this email and any attachments to it:

(a) may be confidential and if you are not the intended recipient, any interference with,
use, disclosure or copying of this material is unauthorised and prohibited; and

(b) may contain personal information of the recipient and/or the sender as defined
under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to
collect, hold and use such information and any personal information contained in a
response to this email, for any reasonable purpose in the ordinary course of
Spherion's
business, including forwarding this email internally or disclosing it to a third party. All
personal information collected by Spherion will be handled in accordance with
Spherion's Privacy Policy. If you have received this email in error, please notify the
sender and delete it.

(c) you agree not to employ or arrange employment for any candidate(s) supplied in
this email and any attachments without first entering into a contractual agreement with
Spherion. You further agree not to divulge any information contained in this document
to any person(s) or entities without the express permission of Spherion.


 


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.