Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] A bad idea to use the XML Schema list type?

From: David Carlisle <davidc@---.--.-->
To: costello@-----.---
Date: 2/9/2009 3:38:00 PM

> Don't use the XML Schema list type.

personally I'd say "dont use (XSD) Schema" but if you are using it then
it makes sense to use technology that understannds its quirks.

In a schema aware xslt 2 transform, for example the sum of the numbers
would just be

<value-of select="sum(Lottery-Drawing/data())"/>


which isn't so bad,

even without a schema aware xslt processor it's only

<value-of select="sum(tokenize(Lottery-Drawing,'\s+'))"/>


If you restrict to xslt 1 then

> With XSLT 1.0 it requires creating a named template that splits the
> string "89 12 41 66 2 26" and then sums the individual tokens. Not an
> easy task 

It's not a very hard task (not much harder than writing the schema
fragments you showed) and it only needs to be done once, if you just
call an exslt template or extension function that splits up a white
space separated string then you don't need to know how that's
implemented, only how it is called.


Are you really saying that xhtml shouldn't have a class attribute that
takes a list of classes, <div class="good bad ugly"><p>....
and instead have a syntax more like
 <div>
  <class>good</class>
  <class>bad</class>
  <class>ugly</class>
  <p>.....


or that xslt 2 shouldn't allow you to say 
<xsl:template mode="a b c">
 ...

and should instead have introduced a mode element child of xsl:template?



David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent