xsl-list
[Top] [All Lists]

RE: mixing it up: REST+XML Namespaces + XLST

2005-04-19 00:38:36
 

    -----Original Message-----
    From: James Fuller 
    performing a GET on top level URL 
    http://www.example.org/app/tables returns
    
    <tables>
    <user xmlns="http://www.example.org/app/tables/user"/>
    <company xmlns="http://www.example.org/app/tables/company"/>
    <products xmlns="http://www.example.org/app/tables/products"/>
    </tables>
    
    note, I have bastardized REST by eschewing with xlink:href 
    (was just transforming them into other things in any event) 
    and defining namespaces.

Why mess with dereferencing namespaces Jim? Why not use your own syntax?
<company lnk="http://www.example.org/app/tables/company"/>

Works just as well, and doesn't upset TAG people!


    so I now find myself doing things like defining namespaces 
    for use in XSLT (though we dont have to explicitly define 
    them, necc);


    then with the various fn:namespace functions e.g.
    fn:namespace-uri,fn:namespace-uri-for-prefix,fn:namespace-ur
    i-from-QName
    I can now infer access these resources with document() calls.


Is this the reason for using namespaces?
(or should that be misusing?)


    
    <xsl:variable name="company" 
    select="document(fn:namespace-uri(.))"/>
    

    With every document() call I recieve xml with relevent 
    namespaces which point to their REST implementation...it 
    feels very state like to me, being passed a namespace which 
    contains its REST URI implementation....would like to hear 
    if anyone else is using XML namespace to their own ends ?

No, but I'd not thought of using namespaces simply to make use
of XSLT 2.0 functionality :-)

Does using a @lnk make you feel any better about it?

Doesn't seem very stateful to me Jim, whichever syntax is used?

regards DaveP


-- 
DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants.  However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent
those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--