Changeset 4678

Show
Ignore:
Timestamp:
05/13/08 17:01:43 (7 months ago)
Author:
xmlhacker
Message:

a whole bunch of new services, and some fixes to the core backend

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/nuxleus/Web/Development/CoreWebApp/service/flickr/return-images-by-tag-name/service.op

    r4545 r4678  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <?xml-stylesheet type="text/xsl" href="/transform/base.xslt"?> 
     2<?xml-stylesheet type="text/xsl" href="/service/transform/controller/proxy/return-images-by-tag-name/base.xslt"?> 
    33<service:operation xmlns:at="http://atomictalk.org" xmlns:metadata="http://xameleon.org/service/metadata" xmlns:header="http://xameleon.org/service/http/header" xmlns:service="http://xameleon.org/service" xmlns:operation="http://xameleon.org/service/operation" xmlns:proxy="http://xameleon.org/service/proxy" xmlns:param="http://xameleon.org/service/session/param"> 
    44  <operation:proxy> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/proxy/return-news-by-location/service.op

    r4545 r4678  
    33<service:operation xmlns:at="http://atomictalk.org" xmlns:metadata="http://xameleon.org/service/metadata" xmlns:header="http://xameleon.org/service/http/header" xmlns:service="http://xameleon.org/service" xmlns:operation="http://xameleon.org/service/operation" xmlns:proxy="http://xameleon.org/service/proxy" xmlns:param="http://xameleon.org/service/session/param"> 
    44  <operation:proxy> 
    5    
    65    <proxy:return-news-by-location location="{query-string:location}" topic="{query-string:topic}"/> 
    76  </operation:proxy> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/proxy/return-xml-from-html/service.op

    r4545 r4678  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <?xml-stylesheet type="text/xsl" href="/service/transform/base.xslt"?> 
     2<?xml-stylesheet type="text/xsl" href="/service/transform/controller/proxy/base.xslt"?> 
    33<service:operation xmlns:service="http://xameleon.org/service" xmlns:operation="http://xameleon.org/service/operation" 
    44    xmlns:param="http://xameleon.org/service/session/param"> 
    5     <param:uri>{query-string:uri}</param:uri> 
    65    <operation:proxy xmlns:proxy="http://xameleon.org/service/proxy"> 
    7         <proxy:return-xml-from-html uri="{$uri}" /> 
     6        <proxy:return-xml-from-html uri="{query-string:uri}" /> 
    87    </operation:proxy> 
    98</service:operation> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/redirect/service.op

    r4545 r4678  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <?xml-stylesheet type="text/xsl" href="/transform/base.xslt"?> 
    3 <service:operation xmlns:at="http://atomictalk.org"  
    4                    xmlns:metadata="http://xameleon.org/service/metadata"  
    5                    xmlns:header="http://xameleon.org/service/http/header"  
    6                    xmlns:service="http://xameleon.org/service"  
    7                    xmlns:operation="http://xameleon.org/service/operation"  
    8                    xmlns:redirect="http://xameleon.org/service/redirect"  
    9                    xmlns:param="http://xameleon.org/service/session/param"> 
    10    
     2<?xml-stylesheet type="text/xsl" href="/service/transform/controller/redirect/base.xslt"?> 
     3<service:operation xmlns:at="http://atomictalk.org" xmlns:metadata="http://xameleon.org/service/metadata" xmlns:header="http://xameleon.org/service/http/header" xmlns:service="http://xameleon.org/service" xmlns:operation="http://xameleon.org/service/operation" xmlns:redirect="http://xameleon.org/service/redirect" xmlns:param="http://xameleon.org/service/session/param"> 
     4 
    115  <param:uri>{query-string:uri}</param:uri> 
    126  <param:status-code>{query-string:status-code}</param:status-code> 
    137 
    148  <operation:redirect> 
    15     <redirect:location uri="{$uri}" status-code="{$status-code}"/> 
     9    <redirect:location uri="{$uri}" status-code="{$status-code}" /> 
    1610  </operation:redirect> 
     11   
    1712</service:operation> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/search/return-artist-info-from-music-brainz/service.op

    r4545 r4678  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <?xml-stylesheet type="text/xsl" href="/transform/base.xslt"?> 
     2<?xml-stylesheet type="text/xsl" href="/service/transform/controller/search/return-artist-info-from-music-brainz/base.xslt"?> 
    33<service:operation  
    44  xmlns:service="http://xameleon.org/service"  
  • trunk/nuxleus/Web/Development/CoreWebApp/service/session/validate-request/service.op

    r4545 r4678  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <?xml-stylesheet type="text/xsl" href="/transform/base.xslt"?> 
     2<?xml-stylesheet type="text/xsl" href="/service/transform/controller/session/validate-request/base.xslt"?> 
    33<service:operation xmlns:at="http://atomictalk.org" xmlns:session="http://xameleon.org/service/session" 
    44    xmlns:header="http://xameleon.org/service/http/header" xmlns:service="http://xameleon.org/service" 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/transform/atomictalk/base.xslt

    r4545 r4678  
    77  Russ Miles (mailto:aohacker@gmail.com; http://www.russmiles.com/) 
    88--> 
    9 <xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:request="http://atomictalk.org/function/aspnet/request" xmlns:session="http://atomictalk.org/session" xmlns:geo="http://nuxleus.com/geo" xmlns:my="http://xameleon.org/my" xmlns:page="http://atomictalk.org/page" xmlns:doc="http://atomictalk.org/feed/doc" xmlns:service="http://atomictalk.org/page/service" xmlns:output="http://atomictalk.org/page/output" xmlns:head="http://atomictalk.org/page/output/head" xmlns:body="http://atomictalk.org/page/output/body" xmlns:advice="http://atomictalk.org/page/advice" xmlns:view="http://atomictalk.org/page/view" xmlns:layout="http://atomictalk.org/page/view/layout" xmlns:form="http://atomictalk.org/page/view/form" xmlns:menu="http://atomictalk.org/page/view/menu" xmlns:exsl="http://exslt.org/common" xmlns:resource="http://atomictalk.org/page/resource" xmlns:model="http://atomictalk.org/page/model" xmlns:app="http://purl.org/atom/app#" xmlns:atompub="http://www.w3.org/2007/app" xmlns:aspnet-context="clitype:System.Web.HttpContext?partialname=System.Web" xmlns:response="http://atomictalk.org/function/aspnet/response" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:func="http://atomictalk.org/function" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="2.0"> 
    10  
    11                <xsl:import href="../atomictalk.base.xslt" /> 
    12  
    13        <xsl:variable name="application-root" select="request:get-physical-application-path()"/> 
    14        <xsl:variable name="session-info" select="document('/service/session/validate-request/')/message"/> 
    15        <xsl:variable name="session-name" select="$session-info/session/@openid"/> 
    16        <xsl:variable name="geo-ip" select="document('/ipgeolocator/geocode')/location"/> 
    17        <xsl:variable name="lat" select="substring-before($geo-ip/point, ' ')"/> 
    18        <xsl:variable name="long" select="substring-after($geo-ip/point, ' ')"/> 
    19        <xsl:variable name="location" select="$geo-ip/city"/> 
    20        <xsl:param name="closure-token-pre-delimiter" select="'|@@'"/> 
    21        <xsl:param name="closure-token-post-delimiter" select="'@@|'"/> 
    22        <xsl:param name="replace-token-pre-delimiter" select="'@@'"/> 
    23        <xsl:param name="replace-token-post-delimiter" select="'@@'"/> 
    24        <xsl:param name="cond-token-pre-delimiter" select="'|$$'"/> 
    25        <xsl:param name="cond-token-post-delimiter" select="'$$|'"/> 
    26        <xsl:param name="cond-if-token" select="'test:'"/> 
    27        <xsl:param name="cond-then-token" select="'IfTrue:'"/> 
    28        <xsl:param name="cond-else-token" select="'IfFalse:'"/> 
    29        <xsl:param name="system-variable-pre-delimiter" select="'%%'"/> 
    30        <xsl:param name="system-variable-post-delimiter" select="'%%'"/> 
    31        <xsl:param name="parameter-list-pre-delimiter" select="'($'"/> 
    32        <xsl:param name="parameter-list-post-delimiter" select="'$)'"/> 
    33        <xsl:param name="parameter-pre-delimiter" select="':'"/> 
    34        <xsl:param name="parameter-post-delimiter" select="':'"/> 
    35        <xsl:param name="replace-parameter-list-pre-delimiter" select="'[$'"/> 
    36        <xsl:param name="replace-parameter-list-post-delimiter" select="'$]'"/> 
    37        <xsl:param name="replace-parameter-pre-delimiter" select="':'"/> 
    38        <xsl:param name="replace-parameter-post-delimiter" select="':'"/> 
    39        <xsl:param name="parameter-list-delimeter" select="','"/> 
    40        <xsl:param name="parameter-value-assigment-token" select="'='"/> 
    41        <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> 
    42        <xsl:variable name="vendor-uri" select="system-property('xsl:vendor-uri')"/> 
    43        <xsl:variable name="page" select="/my:session/my:page"/> 
    44        <xsl:variable name="config" select="$page/page:config"/> 
    45        <xsl:variable name="page.output.config"> 
    46                <xsl:choose> 
    47                        <xsl:when test="$page/page:config/@src"> 
    48                                <xsl:apply-templates select="$page/page:config"/> 
    49                        </xsl:when> 
    50                        <xsl:otherwise> 
    51                                <xsl:apply-templates select="$page/page:output/page:body"/> 
    52                        </xsl:otherwise> 
    53                </xsl:choose> 
    54        </xsl:variable> 
    55        <xsl:variable name="page.output.head" select="document(resolve-uri(concat($application-root, $page/page:output/page:head/@src)))/page:head/*|$page/page:output/page:head/*"/> 
    56        <xsl:variable name="browser" select="$config/page:browser[@vendor = $vendor]/@replace"/> 
    57        <xsl:variable name="advice" select="$config/page:advice"/> 
    58        <xsl:variable name="resource" select="document($page/page:resource/@src)/page:config|$page/page:resource"/> 
    59        <xsl:variable name="service" select="document($page/page:service/@src)/page:config|$page/page:service"/> 
    60        <xsl:variable name="view" select="document($page/page:view/@src)/page:config|$page/page:view"/> 
    61        <xsl:variable name="page.output.body"> 
    62                <xsl:choose> 
    63                        <xsl:when test="$page/page:output/page:body/@src"> 
    64                                <xsl:apply-templates select="document(resolve-uri(concat($application-root,$page/page:output/page:body/@src)))/page:body"/> 
    65                        </xsl:when> 
    66                        <xsl:otherwise> 
    67                                <xsl:apply-templates select="$page/page:output/page:body"/> 
    68                        </xsl:otherwise> 
    69                </xsl:choose> 
    70        </xsl:variable> 
    71        <xsl:variable name="lb"> 
    72                <xsl:text> 
     9<xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:debug="http://nuxleus.com/session/debug" xmlns:request="http://atomictalk.org/function/aspnet/request" xmlns:session="http://atomictalk.org/session" xmlns:geo="http://nuxleus.com/geo" xmlns:my="http://xameleon.org/my" xmlns:page="http://atomictalk.org/page" xmlns:doc="http://atomictalk.org/feed/doc" xmlns:service="http://atomictalk.org/page/service" xmlns:output="http://atomictalk.org/page/output" xmlns:head="http://atomictalk.org/page/output/head" xmlns:body="http://atomictalk.org/page/output/body" xmlns:advice="http://atomictalk.org/page/advice" xmlns:view="http://atomictalk.org/page/view" xmlns:layout="http://atomictalk.org/page/view/layout" xmlns:form="http://atomictalk.org/page/view/form" xmlns:menu="http://atomictalk.org/page/view/menu" xmlns:exsl="http://exslt.org/common" xmlns:resource="http://atomictalk.org/page/resource" xmlns:model="http://atomictalk.org/page/model" xmlns:app="http://purl.org/atom/app#" xmlns:atompub="http://www.w3.org/2007/app" xmlns:aspnet-context="clitype:System.Web.HttpContext?partialname=System.Web" xmlns:response="http://atomictalk.org/function/aspnet/response" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:func="http://atomictalk.org/function" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="2.0"> 
     10                 
     11  <xsl:import href="../atomictalk.base.xslt" /> 
     12         
     13  <xsl:variable name="application-root" select="request:get-physical-application-path()"/> 
     14  <xsl:variable name="session-info" select="document('/service/session/validate-request/')/message"/> 
     15  <xsl:variable name="session-name" select="$session-info/session/@openid"/> 
     16  <xsl:variable name="geo-ip" select="document('/ipgeolocator/geocode')/location"/> 
     17  <xsl:variable name="lat" select="substring-before($geo-ip/point, ' ')"/> 
     18  <xsl:variable name="long" select="substring-after($geo-ip/point, ' ')"/> 
     19  <xsl:variable name="location" select="$geo-ip/city"/> 
     20  <xsl:param name="closure-token-pre-delimiter" select="'|@@'"/> 
     21  <xsl:param name="closure-token-post-delimiter" select="'@@|'"/> 
     22  <xsl:param name="replace-token-pre-delimiter" select="'@@'"/> 
     23  <xsl:param name="replace-token-post-delimiter" select="'@@'"/> 
     24  <xsl:param name="cond-token-pre-delimiter" select="'|$$'"/> 
     25  <xsl:param name="cond-token-post-delimiter" select="'$$|'"/> 
     26  <xsl:param name="cond-if-token" select="'test:'"/> 
     27  <xsl:param name="cond-then-token" select="'IfTrue:'"/> 
     28  <xsl:param name="cond-else-token" select="'IfFalse:'"/> 
     29  <xsl:param name="system-variable-pre-delimiter" select="'%%'"/> 
     30  <xsl:param name="system-variable-post-delimiter" select="'%%'"/> 
     31  <xsl:param name="parameter-list-pre-delimiter" select="'($'"/> 
     32  <xsl:param name="parameter-list-post-delimiter" select="'$)'"/> 
     33  <xsl:param name="parameter-pre-delimiter" select="':'"/> 
     34  <xsl:param name="parameter-post-delimiter" select="':'"/> 
     35  <xsl:param name="replace-parameter-list-pre-delimiter" select="'[$'"/> 
     36  <xsl:param name="replace-parameter-list-post-delimiter" select="'$]'"/> 
     37  <xsl:param name="replace-parameter-pre-delimiter" select="':'"/> 
     38  <xsl:param name="replace-parameter-post-delimiter" select="':'"/> 
     39  <xsl:param name="parameter-list-delimeter" select="','"/> 
     40  <xsl:param name="parameter-value-assigment-token" select="'='"/> 
     41  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> 
     42  <xsl:variable name="vendor-uri" select="system-property('xsl:vendor-uri')"/> 
     43  <xsl:variable name="page" select="/my:session/my:page"/> 
     44  <xsl:variable name="config" select="$page/page:config"/> 
     45  <xsl:variable name="page.output.config"> 
     46    <xsl:choose> 
     47      <xsl:when test="$page/page:config/@src"> 
     48        <xsl:apply-templates select="$page/page:config"/> 
     49      </xsl:when> 
     50      <xsl:otherwise> 
     51        <xsl:apply-templates select="$page/page:output/page:body"/> 
     52      </xsl:otherwise> 
     53    </xsl:choose> 
     54  </xsl:variable> 
     55  <xsl:variable name="page.output.head" select="document(resolve-uri(concat($application-root, $page/page:output/page:head/@src)))/page:head/*|$page/page:output/page:head/*"/> 
     56  <xsl:variable name="browser" select="$config/page:browser[@vendor = $vendor]/@replace"/> 
     57  <xsl:variable name="advice" select="$config/page:advice"/> 
     58  <xsl:variable name="resource" select="document($page/page:resource/@src)/page:config|$page/page:resource"/> 
     59  <xsl:variable name="service" select="document($page/page:service/@src)/page:config|$page/page:service"/> 
     60  <xsl:variable name="view" select="document($page/page:view/@src)/page:config|$page/page:view"/> 
     61  <xsl:variable name="page.output.body"> 
     62    <xsl:choose> 
     63      <xsl:when test="$page/page:output/page:body/@src"> 
     64        <xsl:apply-templates select="document(resolve-uri(concat($application-root,$page/page:output/page:body/@src)))/page:body"/> 
     65      </xsl:when> 
     66      <xsl:otherwise> 
     67        <xsl:apply-templates select="$page/page:output/page:body"/> 
     68      </xsl:otherwise> 
     69    </xsl:choose> 
     70  </xsl:variable> 
     71  <xsl:variable name="lb"> 
     72    <xsl:text> 
    7373</xsl:text> 
    74         </xsl:variable> 
    75         <xsl:variable name="q">"</xsl:variable> 
    76         <xsl:variable name="sq">'</xsl:variable> 
    77         <xsl:variable name="base-uri"> 
    78                 <xsl:choose> 
    79                         <xsl:when test="$page[@xml:base]"> 
    80                                 <xsl:value-of select="$page/@xml:base"/> 
    81                         </xsl:when> 
    82                         <xsl:otherwise> 
    83                                 <xsl:call-template name="replace"> 
    84                                         <xsl:with-param name="string" select="$advice/advice:*[local-name() = 'base-uri']/*"/> 
    85                                 </xsl:call-template> 
    86                         </xsl:otherwise> 
    87                 </xsl:choose> 
    88         </xsl:variable> 
    89         <xsl:strip-space elements="html:*"/> 
    90         <xsl:output cdata-section-elements="script" method="xml" indent="yes"/> 
    91         <xsl:template match="my:session"> 
    92                 <xsl:processing-instruction name="xml-stylesheet"> 
    93                         <xsl:value-of select="concat('type=', $q, 'text/xsl', $q, ' ', 'href=', $q, '/page/controller/atomictalk/base.xsl', $q)"/> 
    94                 </xsl:processing-instruction> 
    95                 <xsl:variable name="content-type" select="response:set-content-type('text/xml')"/> 
    96                 <my:session content-type="{if(not(empty($content-type))) then 'text/xml' else 'not-set'}"> 
    97                         <xsl:copy-of select="@*"/> 
    98                         <xsl:apply-templates/> 
    99                 </my:session> 
    100         </xsl:template> 
    101         <xsl:template match="my:page"> 
    102                 <my:page> 
    103                         <xsl:copy-of select="@*"/> 
    104                         <xsl:apply-templates/> 
    105                 </my:page> 
    106         </xsl:template> 
    107         <xsl:template match="page:output"> 
    108                 <page:output> 
    109                         <page:head> 
    110                                 <xsl:copy-of select="$page.output.head"/> 
    111                         </page:head> 
    112                         <xsl:copy-of select="$page.output.body"/> 
    113                 </page:output> 
    114         </xsl:template> 
    115         <xsl:template match="page:config"> 
    116                 <page:config> 
    117                         <page:advice> 
    118                                 <xsl:apply-templates select="document(resolve-uri(concat($application-root,$page/page:config/@src)))/page:config/page:advice/*" mode="resolve"/> 
    119                                 <xsl:apply-templates select="page:advice/*"/> 
    120                         </page:advice> 
    121                 </page:config> 
    122         </xsl:template> 
    123         <xsl:template match="page:head"> 
    124                 <page:head> 
    125                         <xsl:copy-of select="*"/> 
    126                 </page:head> 
    127         </xsl:template> 
    128         <xsl:template match="page:body"> 
    129                 <page:body> 
    130                         <xsl:apply-templates/> 
    131                 </page:body> 
    132         </xsl:template> 
    133         <xsl:template match="body:onload|body:onresize|body:onunload|head:include|head:title|head:link|body:layout"> 
    134                 <xsl:element name="{name()}"> 
    135                         <xsl:copy-of select="@*"/> 
    136                         <xsl:apply-templates/> 
    137                 </xsl:element> 
    138         </xsl:template> 
    139         <xsl:template name="resolve-uri"> 
    140                 <xsl:param name="href"/> 
    141                 <xsl:call-template name="replace"> 
    142                         <xsl:with-param name="string" select="translate($href, ' ', '')"/> 
    143                 </xsl:call-template> 
    144         </xsl:template> 
    145         <xsl:template match="advice:*" mode="resolve"> 
    146                 <xsl:element name="{name()}"> 
    147                         <xsl:copy-of select="@*"/> 
    148                         <xsl:call-template name="replace"> 
    149                                 <xsl:with-param name="string" select="."/> 
    150                         </xsl:call-template> 
    151                 </xsl:element> 
    152         </xsl:template> 
    153         <xsl:template match="advice:*"> 
    154                 <xsl:copy-of select="."/> 
    155         </xsl:template> 
    156         <xsl:template match="session:*"> 
    157                 <xsl:copy-of select="."/> 
    158         </xsl:template> 
    159         <xsl:template match="geo:map"> 
    160                 <xsl:copy-of select="."/> 
    161         </xsl:template> 
    162         <xsl:template match="geo:location"> 
    163                 <xsl:copy-of select="."/> 
    164         </xsl:template> 
    165         <xsl:template match="doc:*"> 
    166                 <xsl:copy-of select="."/> 
    167         </xsl:template> 
    168         <xsl:template match="*" mode="message"> 
    169                 <xsl:element name="{name()}"> 
    170                         <xsl:copy-of select="@*"/> 
    171                         <xsl:apply-templates/> 
    172                 </xsl:element> 
    173         </xsl:template> 
    174         <xsl:template match="view:module[@src]|view:item[@src]"> 
    175                 <xsl:apply-templates select="document(resolve-uri(concat($application-root,@src)))"/> 
    176         </xsl:template> 
    177         <xsl:template match="page:*|view:*|page:heading"> 
    178                 <xsl:element name="{name()}"> 
    179                         <xsl:copy-of select="@*"/> 
    180                         <xsl:apply-templates/> 
    181                 </xsl:element> 
    182         </xsl:template> 
    183         <xsl:template match="*"> 
    184                 <xsl:element name="{local-name()}"> 
    185                         <xsl:apply-templates select="@*"/> 
    186                         <xsl:apply-templates/> 
    187                 </xsl:element> 
    188         </xsl:template> 
    189         <xsl:template match="@*"> 
    190                 <xsl:attribute name="{local-name()}"> 
    191                         <xsl:call-template name="replace"> 
    192                                 <xsl:with-param name="string" select="."/> 
    193                         </xsl:call-template> 
    194                 </xsl:attribute> 
    195         </xsl:template> 
    196         <xsl:template match="text()"> 
    197                 <xsl:call-template name="replace"> 
    198                         <xsl:with-param name="string" select="."/> 
    199                 </xsl:call-template> 
    200         </xsl:template> 
    201         <xsl:template name="replace"> 
    202                 <xsl:param name="string"/> 
    203                 <xsl:variable name="nString"> 
    204                         <xsl:call-template name="cond"> 
    205                                 <xsl:with-param name="string" select="$string"/> 
    206                         </xsl:call-template> 
    207                 </xsl:variable> 
    208                 <xsl:choose> 
    209                         <xsl:when test="contains($nString, $closure-token-pre-delimiter)"> 
    210                                 <xsl:variable name="name" select="substring-before(substring-before(substring-after($nString, $closure-token-pre-delimiter), $closure-token-post-delimiter), $parameter-list-pre-delimiter)"/> 
    211                                 <xsl:call-template name="replace-vars"> 
    212                                         <xsl:with-param name="value-string" select="substring-before(substring-after($nString, $parameter-list-pre-delimiter), $parameter-list-post-delimiter)"/> 
    213                                         <xsl:with-param name="replace-var-string" select="substring-before(substring-after($advice/advice:*[local-name() = $name]/text(), $replace-parameter-list-pre-delimiter), $replace-parameter-list-post-delimiter)"/> 
    214                                 </xsl:call-template> 
    215                         </xsl:when> 
    216                         <xsl:when test="contains($nString, $replace-token-pre-delimiter)"> 
    217                                 <xsl:variable name="name" select="substring-before(substring-after($nString, $replace-token-pre-delimiter), $replace-token-pre-delimiter)"/> 
    218                                 <xsl:variable name="replace-with"> 
    219                                         <xsl:apply-templates select="$advice/advice:*[local-name() = $name]"/> 
    220                                 </xsl:variable> 
    221                                 <xsl:call-template name="replace"> 
    222                                         <xsl:with-param name="string" select="concat(substring-before($nString, concat($replace-token-pre-delimiter, $name)), $replace-with, substring-after($nString, concat($name, $replace-token-pre-delimiter)))"/> 
    223                                 </xsl:call-template> 
    224                         </xsl:when> 
    225                         <xsl:otherwise> 
    226                                 <xsl:value-of select="$nString"/> 
    227                         </xsl:otherwise> 
    228                 </xsl:choose> 
    229         </xsl:template> 
    230         <xsl:template name="cond"> 
    231                 <xsl:param name="string"/> 
    232                 <xsl:choose> 
    233                         <xsl:when test="contains($string, $cond-token-pre-delimiter)"> 
    234                                 <xsl:variable name="sString" select="translate($string, ' ', '')"/> 
    235                                 <xsl:variable name="conditional" select="substring-before(substring-after($sString, $cond-token-pre-delimiter), $cond-token-post-delimiter)"/> 
    236                                 <xsl:variable name="pre-cond" select="substring-before($sString, $cond-token-pre-delimiter)"/> 
    237                                 <xsl:variable name="post-cond" select="substring-after($sString, $cond-token-post-delimiter)"/> 
    238                                 <xsl:variable name="if" select="substring-before(substring-after($conditional, $cond-if-token), $cond-then-token)"/> 
    239                                 <xsl:variable name="then" select="substring-before(substring-after($conditional, $cond-then-token), $cond-else-token)"/> 
    240                                 <xsl:variable name="else" select="substring-after($conditional, $cond-else-token)"/> 
    241                                 <xsl:variable name="nString"> 
    242                                         <xsl:choose> 
    243                                                 <xsl:when test="$advice/advice:*[local-name() = substring-before(substring-after($if, '@@'), '@@')]"> 
    244                                                         <xsl:variable name="replace-string"> 
    245                                                                 <xsl:call-template name="replace"> 
    246                                                                         <xsl:with-param name="string" select="$then"/> 
    247                                                                 </xsl:call-template> 
    248                                                         </xsl:variable> 
    249                                                         <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
    250                                                 </xsl:when> 
    251                                                 <xsl:otherwise> 
    252                                                         <xsl:variable name="replace-string"> 
    253                                                                 <xsl:call-template name="replace"> 
    254                                                                         <xsl:with-param name="string" select="$else"/> 
    255                                                                 </xsl:call-template> 
    256                                                         </xsl:variable> 
    257                                                         <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
    258                                                 </xsl:otherwise> 
    259                                         </xsl:choose> 
    260                                 </xsl:variable> 
    261                                 <xsl:call-template name="cond"> 
    262                                         <xsl:with-param name="string" select="$nString"/> 
    263                                 </xsl:call-template> 
    264                         </xsl:when> 
    265                         <xsl:otherwise> 
    266                                 <xsl:value-of select="$string"/> 
    267                         </xsl:otherwise> 
    268                 </xsl:choose> 
    269         </xsl:template> 
    270         <xsl:template name="replace-vars"> 
    271                 <xsl:param name="value-string"/> 
    272                 <xsl:param name="replace-var-string"/> 
    273                 <xsl:variable name="nValue-string"> 
    274                         <xsl:call-template name="replace"> 
    275                                 <xsl:with-param name="string" select="$value-string"/> 
    276                         </xsl:call-template> 
    277                 </xsl:variable> 
    278                 <xsl:variable name="nReplace-var-string"> 
    279                         <xsl:call-template name="replace"> 
    280                                 <xsl:with-param name="string" select="$replace-var-string"/> 
    281                         </xsl:call-template> 
    282                 </xsl:variable> 
    283                 <xsl:variable name="name" select="substring-before(substring-after($nValue-string, $parameter-pre-delimiter), $parameter-post-delimiter)"/> 
    284                 <xsl:variable name="value" select="substring-before(substring-after($nValue-string, concat($parameter-value-assigment-token, $sq)), $sq)"/> 
    285                 <xsl:variable name="evaluated-value" select="concat(substring-before($nReplace-var-string, concat($replace-parameter-pre-delimiter, $name)), $value, substring-after($nReplace-var-string, concat($name, $replace-parameter-post-delimiter)))"/> 
    286                 <xsl:variable name="next" select="substring-after($nValue-string, $parameter-list-delimeter)"/> 
    287                 <xsl:choose> 
    288                         <xsl:when test="$next"> 
    289                                 <xsl:call-template name="replace-vars"> 
    290                                         <xsl:with-param name="value-string" select="$next"/> 
    291                                         <xsl:with-param name="replace-var-string" select="$evaluated-value"/> 
    292                                 </xsl:call-template> 
    293                         </xsl:when> 
    294                         <xsl:otherwise> 
    295                                 <xsl:value-of select="$evaluated-value"/> 
    296                         </xsl:otherwise> 
    297                 </xsl:choose> 
    298         </xsl:template> 
     74  </xsl:variable> 
     75  <xsl:variable name="q">"</xsl:variable> 
     76  <xsl:variable name="sq">'</xsl:variable> 
     77  <xsl:variable name="base-uri"> 
     78    <xsl:choose> 
     79      <xsl:when test="$page[@xml:base]"> 
     80        <xsl:value-of select="$page/@xml:base"/> 
     81      </xsl:when> 
     82      <xsl:otherwise> 
     83        <xsl:call-template name="replace"> 
     84          <xsl:with-param name="string" select="$advice/advice:*[local-name() = 'base-uri']/*"/> 
     85        </xsl:call-template> 
     86      </xsl:otherwise> 
     87    </xsl:choose> 
     88  </xsl:variable> 
     89  <xsl:strip-space elements="html:*"/> 
     90  <xsl:output cdata-section-elements="script" method="xml" indent="yes"/> 
     91  <xsl:template match="my:session"> 
     92    <xsl:processing-instruction name="xml-stylesheet"> 
     93      <xsl:value-of select="concat('type=', $q, 'text/xsl', $q, ' ', 'href=', $q, '/page/controller/atomictalk/base.xsl', $q)"/> 
     94    </xsl:processing-instruction> 
     95    <xsl:variable name="content-type" select="response:set-content-type('text/xml')"/> 
     96    <my:session content-type="{if(not(empty($content-type))) then 'text/xml' else 'not-set'}"> 
     97      <xsl:copy-of select="@*"/> 
     98      <xsl:apply-templates/> 
     99    </my:session> 
     100  </xsl:template> 
     101  <xsl:template match="debug:info"> 
     102    <debug:info/> 
     103  </xsl:template> 
     104  <xsl:template match="geo:*"> 
     105    <xsl:copy-of select="."/> 
     106  </xsl:template> 
     107  <xsl:template match="my:page"> 
     108    <my:page> 
     109      <xsl:copy-of select="@*"/> 
     110      <xsl:apply-templates/> 
     111    </my:page> 
     112  </xsl:template> 
     113  <xsl:template match="page:output"> 
     114    <page:output> 
     115      <page:head> 
     116        <xsl:copy-of select="$page.output.head"/> 
     117      </page:head> 
     118      <xsl:copy-of select="$page.output.body"/> 
     119    </page:output> 
     120  </xsl:template> 
     121  <xsl:template match="page:config"> 
     122    <page:config> 
     123      <page:advice> 
     124        <xsl:apply-templates select="document(resolve-uri(concat($application-root,$page/page:config/@src)))/page:config/page:advice/*" mode="resolve"/> 
     125        <xsl:apply-templates select="page:advice/*"/> 
     126      </page:advice> 
     127    </page:config> 
     128  </xsl:template> 
     129  <xsl:template match="page:head"> 
     130    <page:head> 
     131      <xsl:copy-of select="*"/> 
     132    </page:head> 
     133  </xsl:template> 
     134  <xsl:template match="page:body"> 
     135    <page:body> 
     136      <xsl:apply-templates/> 
     137    </page:body> 
     138  </xsl:template> 
     139  <xsl:template match="body:onload|body:onresize|body:onunload|head:include|head:title|head:link|body:layout"> 
     140    <xsl:element name="{name()}"> 
     141      <xsl:copy-of select="@*"/> 
     142      <xsl:apply-templates/> 
     143    </xsl:element> 
     144  </xsl:template> 
     145  <xsl:template name="resolve-uri"> 
     146    <xsl:param name="href"/> 
     147    <xsl:call-template name="replace"> 
     148      <xsl:with-param name="string" select="translate($href, ' ', '')"/> 
     149    </xsl:call-template> 
     150  </xsl:template> 
     151  <xsl:template match="advice:*" mode="resolve"> 
     152    <xsl:element name="{name()}"> 
     153      <xsl:copy-of select="@*"/> 
     154      <xsl:call-template name="replace"> 
     155        <xsl:with-param name="string" select="."/> 
     156      </xsl:call-template> 
     157    </xsl:element> 
     158  </xsl:template> 
     159  <xsl:template match="advice:*"> 
     160    <xsl:copy-of select="."/> 
     161  </xsl:template> 
     162  <xsl:template match="session:*"> 
     163    <xsl:copy-of select="."/> 
     164  </xsl:template> 
     165  <xsl:template match="geo:map"> 
     166    <xsl:copy-of select="."/> 
     167  </xsl:template> 
     168  <xsl:template match="geo:location"> 
     169    <xsl:copy-of select="."/> 
     170  </xsl:template> 
     171  <xsl:template match="doc:*"> 
     172    <xsl:copy-of select="."/> 
     173  </xsl:template> 
     174  <xsl:template match="*" mode="message"> 
     175    <xsl:element name="{name()}"> 
     176      <xsl:copy-of select="@*"/> 
     177      <xsl:apply-templates/> 
     178    </xsl:element> 
     179  </xsl:template> 
     180  <xsl:template match="view:module[@src]|view:item[@src]"> 
     181    <xsl:apply-templates select="document(resolve-uri(concat($application-root,@src)))"/> 
     182  </xsl:template> 
     183  <xsl:template match="page:*|view:*|page:heading"> 
     184    <xsl:element name="{name()}"> 
     185      <xsl:copy-of select="@*"/> 
     186      <xsl:apply-templates/> 
     187    </xsl:element> 
     188  </xsl:template> 
     189  <xsl:template match="*"> 
     190    <xsl:element name="{local-name()}"> 
     191      <xsl:apply-templates select="@*"/> 
     192      <xsl:apply-templates/> 
     193    </xsl:element> 
     194  </xsl:template> 
     195  <xsl:template match="@*"> 
     196    <xsl:attribute name="{local-name()}"> 
     197      <xsl:call-template name="replace"> 
     198        <xsl:with-param name="string" select="."/> 
     199      </xsl:call-template> 
     200    </xsl:attribute> 
     201  </xsl:template> 
     202  <xsl:template match="text()"> 
     203    <xsl:call-template name="replace"> 
     204      <xsl:with-param name="string" select="."/> 
     205    </xsl:call-template> 
     206  </xsl:template> 
     207  <xsl:template name="replace"> 
     208    <xsl:param name="string"/> 
     209    <xsl:variable name="nString"> 
     210      <xsl:call-template name="cond"> 
     211        <xsl:with-param name="string" select="$string"/> 
     212      </xsl:call-template> 
     213    </xsl:variable> 
     214    <xsl:choose> 
     215      <xsl:when test="contains($nString, $closure-token-pre-delimiter)"> 
     216        <xsl:variable name="name" select="substring-before(substring-before(substring-after($nString, $closure-token-pre-delimiter), $closure-token-post-delimiter), $parameter-list-pre-delimiter)"/> 
     217        <xsl:call-template name="replace-vars"> 
     218          <xsl:with-param name="value-string" select="substring-before(substring-after($nString, $parameter-list-pre-delimiter), $parameter-list-post-delimiter)"/> 
     219          <xsl:with-param name="replace-var-string" select="substring-before(substring-after($advice/advice:*[local-name() = $name]/text(), $replace-parameter-list-pre-delimiter), $replace-parameter-list-post-delimiter)"/> 
     220        </xsl:call-template> 
     221      </xsl:when> 
     222      <xsl:when test="contains($nString, $replace-token-pre-delimiter)"> 
     223        <xsl:variable name="name" select="substring-before(substring-after($nString, $replace-token-pre-delimiter), $replace-token-pre-delimiter)"/> 
     224        <xsl:variable name="replace-with"> 
     225          <xsl:apply-templates select="$advice/advice:*[local-name() = $name]"/> 
     226        </xsl:variable> 
     227        <xsl:call-template name="replace"> 
     228          <xsl:with-param name="string" select="concat(substring-before($nString, concat($replace-token-pre-delimiter, $name)), $replace-with, substring-after($nString, concat($name, $replace-token-pre-delimiter)))"/> 
     229        </xsl:call-template> 
     230      </xsl:when> 
     231      <xsl:otherwise> 
     232        <xsl:value-of select="$nString"/> 
     233      </xsl:otherwise> 
     234    </xsl:choose> 
     235  </xsl:template> 
     236  <xsl:template name="cond"> 
     237    <xsl:param name="string"/> 
     238    <xsl:choose> 
     239      <xsl:when test="contains($string, $cond-token-pre-delimiter)"> 
     240        <xsl:variable name="sString" select="translate($string, ' ', '')"/> 
     241        <xsl:variable name="conditional" select="substring-before(substring-after($sString, $cond-token-pre-delimiter), $cond-token-post-delimiter)"/> 
     242        <xsl:variable name="pre-cond" select="substring-before($sString, $cond-token-pre-delimiter)"/> 
     243        <xsl:variable name="post-cond" select="substring-after($sString, $cond-token-post-delimiter)"/> 
     244        <xsl:variable name="if" select="substring-before(substring-after($conditional, $cond-if-token), $cond-then-token)"/> 
     245        <xsl:variable name="then" select="substring-before(substring-after($conditional, $cond-then-token), $cond-else-token)"/> 
     246        <xsl:variable name="else" select="substring-after($conditional, $cond-else-token)"/> 
     247        <xsl:variable name="nString"> 
     248          <xsl:choose> 
     249            <xsl:when test="$advice/advice:*[local-name() = substring-before(substring-after($if, '@@'), '@@')]"> 
     250              <xsl:variable name="replace-string"> 
     251                <xsl:call-template name="replace"> 
     252                  <xsl:with-param name="string" select="$then"/> 
     253                </xsl:call-template> 
     254              </xsl:variable> 
     255              <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
     256            </xsl:when> 
     257            <xsl:otherwise> 
     258              <xsl:variable name="replace-string"> 
     259                <xsl:call-template name="replace"> 
     260                  <xsl:with-param name="string" select="$else"/> 
     261                </xsl:call-template> 
     262              </xsl:variable> 
     263              <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
     264            </xsl:otherwise> 
     265          </xsl:choose> 
     266        </xsl:variable> 
     267        <xsl:call-template name="cond"> 
     268          <xsl:with-param name="string" select="$nString"/> 
     269        </xsl:call-template> 
     270      </xsl:when> 
     271      <xsl:otherwise> 
     272        <xsl:value-of select="$string"/> 
     273      </xsl:otherwise> 
     274    </xsl:choose> 
     275  </xsl:template> 
     276  <xsl:template name="replace-vars"> 
     277    <xsl:param name="value-string"/> 
     278    <xsl:param name="replace-var-string"/> 
     279    <xsl:variable name="nValue-string"> 
     280      <xsl:call-template name="replace"> 
     281        <xsl:with-param name="string" select="$value-string"/> 
     282      </xsl:call-template> 
     283    </xsl:variable> 
     284    <xsl:variable name="nReplace-var-string"> 
     285      <xsl:call-template name="replace"> 
     286        <xsl:with-param name="string" select="$replace-var-string"/> 
     287      </xsl:call-template> 
     288    </xsl:variable> 
     289    <xsl:variable name="name" select="substring-before(substring-after($nValue-string, $parameter-pre-delimiter), $parameter-post-delimiter)"/> 
     290    <xsl:variable name="value" select="substring-before(substring-after($nValue-string, concat($parameter-value-assigment-token, $sq)), $sq)"/> 
     291    <xsl:variable name="evaluated-value" select="concat(substring-before($nReplace-var-string, concat($replace-parameter-pre-delimiter, $name)), $value, substring-after($nReplace-var-string, concat($name, $replace-parameter-post-delimiter)))"/> 
     292    <xsl:variable name="next" select="substring-after($nValue-string, $parameter-list-delimeter)"/> 
     293    <xsl:choose> 
     294      <xsl:when test="$next"> 
     295        <xsl:call-template name="replace-vars"> 
     296          <xsl:with-param name="value-string" select="$next"/> 
     297          <xsl:with-param name="replace-var-string" select="$evaluated-value"/> 
     298        </xsl:call-template> 
     299      </xsl:when> 
     300      <xsl:otherwise> 
     301        <xsl:value-of select="$evaluated-value"/> 
     302      </xsl:otherwise> 
     303    </xsl:choose> 
     304  </xsl:template> 
    299305</xsl:stylesheet> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/transform/base.xslt

    r4545 r4678  
    4545    </xsl:character-map> 
    4646 
    47  
    4847    <xsl:output name="xhtml" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1.1.dtd" 
    4948        include-content-type="yes" indent="no" media-type="text/html" method="xhtml" /> 
  • trunk/nuxleus/Web/Development/CoreWebApp/service/transform/controller/atomictalk/base.xslt

    r4545 r4678  
    77  Russ Miles (mailto:aohacker@gmail.com; http://www.russmiles.com/) 
    88--> 
    9 <xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:request-collection="clitype:Xameleon.Function.HttpRequestCollection?partialname=Xameleon" xmlns:request="http://atomictalk.org/function/aspnet/request" xmlns:session="http://atomictalk.org/session" xmlns:geo="http://nuxleus.com/geo" xmlns:my="http://xameleon.org/my" xmlns:page="http://atomictalk.org/page" xmlns:doc="http://atomictalk.org/feed/doc" xmlns:service="ht