Changeset 4624

Show
Ignore:
Timestamp:
02/18/08 16:38:33 (10 months ago)
Author:
xmlhacker
Message:

more debug info

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/nuxleus/Web/4lessig.org/index.page

    r4621 r4624  
    1717        <page:output> 
    1818            <page:head src="/page/output/head/base.xml" /> 
    19             <page:body src="/page/output/body/base.xml" /> 
     19            <page:body src="/page/output/body/base.xml" />  
    2020        </page:output> 
    2121    </my:page> 
  • trunk/nuxleus/Web/4lessig.org/page/controller/atomictalk/base.xsl

    r4623 r4624  
    77  Russ Miles (mailto:aohacker@gmail.com; http://www.russmiles.com/) 
    88--> 
    9 <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:request="http://nuxleus.com/session/request" xmlns:response="http://nuxleus.com/message/response" 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:atom="http://www.w3.org/2005/Atom" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="html exsl my app response advice atom head page service resource output form body view menu model msxsl doc atompub"> 
     9<xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:debug="http://nuxleus.com/session/debug" xmlns:request="http://nuxleus.com/session/request" xmlns:response="http://nuxleus.com/message/response" 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:atom="http://www.w3.org/2005/Atom" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="html exsl my app response advice atom head page service resource output form body view menu model msxsl doc atompub"> 
    1010 
    1111  <xsl:param name="closure-token-pre-delimiter" select="'|@@'"/> 
     
    3838  <xsl:variable name="request-time" select="$session-info/response:request-time"/> 
    3939  <xsl:variable name="geo-ip" select="$session-info/response:geo"/> 
    40   <xsl:variable name="ip" select="$geo-ip//response:ip"/> 
    41   <xsl:variable name="location" select="$geo-ip/response:city"/> 
    42   <xsl:variable name="lat" select="$geo-ip//response:lat"/> 
    43   <xsl:variable name="long" select="$geo-ip//response:long"/> 
     40  <xsl:variable name="ip" select="$geo-ip/response:ip"/> 
     41  <xsl:variable name="city" select="$geo-ip/response:city"/> 
     42  <xsl:variable name="country" select="$geo-ip/response:country"/> 
     43  <xsl:variable name="lat" select="$geo-ip/response:lat"/> 
     44  <xsl:variable name="long" select="$geo-ip/response:long"/> 
    4445 
    4546  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> 
     
    8384 
    8485  <xsl:output cdata-section-elements="script" doctype-system="-//W3C//DTD HTML 4.01//EN" doctype-public="http://www.w3.org/TR/html4/strict.dtd" method="html" indent="no"/> 
    85  
     86   
    8687  <xsl:template match="my:session"> 
    8788    <xsl:apply-templates/> 
     
    259260 
    260261  <xsl:template match="geo:location"> 
    261     <xsl:value-of select="$location"/> 
     262    <xsl:value-of select="$city"/> 
    262263  </xsl:template> 
    263264 
  • trunk/nuxleus/Web/4lessig.org/page/view/form/add-support.xml

    r4621 r4624  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <view:module class="base" id="instance" xmlns="http://www.w3.org/1999/xhtml" xmlns:request="http://nuxleus.com/session/request" xmlns:session="http://atomictalk.org/session" xmlns:geo="http://nuxleus.com/geo" xmlns:doc="http://atomictalk.org/feed/doc" xmlns:view="http://atomictalk.org/page/view"> 
     2<view:module class="base" id="instance" xmlns="http://www.w3.org/1999/xhtml" xmlns:debug="http://nuxleus.com/session/debug" xmlns:request="http://nuxleus.com/session/request" xmlns:session="http://atomictalk.org/session" xmlns:geo="http://nuxleus.com/geo" xmlns:doc="http://atomictalk.org/feed/doc" xmlns:view="http://atomictalk.org/page/view"> 
    33  <div class="form" id="pledgeSupport"> 
    44    <h1>Pledge your support 4Lessig 4Congress!</h1> 
     
    3434      <li>City: <geo:location /> 
    3535      </li> 
     36      <li>Country: <geo:country /> 
     37      </li> 
    3638      <li>GeoLat: <geo:lat /> 
    3739      </li> 
  • trunk/nuxleus/Web/4lessig.org/service/transform/atomictalk/base.xslt

    r4599 r4624  
    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> 
    73 </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> 
     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></xsl:text> 
     73  </xsl:variable> 
     74  <xsl:variable name="q">"</xsl:variable> 
     75  <xsl:variable name="sq">'</xsl:variable> 
     76  <xsl:variable name="base-uri"> 
     77    <xsl:choose> 
     78      <xsl:when test="$page[@xml:base]"> 
     79        <xsl:value-of select="$page/@xml:base"/> 
     80      </xsl:when> 
     81      <xsl:otherwise> 
     82        <xsl:call-template name="replace"> 
     83          <xsl:with-param name="string" select="$advice/advice:*[local-name() = 'base-uri']/*"/> 
     84        </xsl:call-template> 
     85      </xsl:otherwise> 
     86    </xsl:choose> 
     87  </xsl:variable> 
     88  <xsl:strip-space elements="html:*"/> 
     89  <xsl:output cdata-section-elements="script" method="xml" indent="yes"/> 
     90  <xsl:template match="my:session"> 
     91    <xsl:processing-instruction name="xml-stylesheet"> 
     92      <xsl:value-of select="concat('type=', $q, 'text/xsl', $q, ' ', 'href=', $q, '/page/controller/atomictalk/base.xsl', $q)"/> 
     93    </xsl:processing-instruction> 
     94    <xsl:variable name="content-type" select="response:set-content-type('text/xml')"/> 
     95    <my:session content-type="{if(not(empty($content-type))) then 'text/xml' else 'not-set'}"> 
     96      <xsl:copy-of select="@*"/> 
     97      <xsl:apply-templates/> 
     98    </my:session> 
     99  </xsl:template> 
     100  <xsl:template match="debug:info"> 
     101    <debug:info/> 
     102  </xsl:template> 
     103  <xsl:template match="geo:*"> 
     104    <xsl:copy-of select="."/> 
     105  </xsl:template> 
     106  <xsl:template match="my:page"> 
     107    <my:page> 
     108      <xsl:copy-of select="@*"/> 
     109      <xsl:apply-templates/> 
     110    </my:page> 
     111  </xsl:template> 
     112  <xsl:template match="page:output"> 
     113    <page:output> 
     114      <page:head> 
     115        <xsl:copy-of select="$page.output.head"/> 
     116      </page:head> 
     117      <xsl:copy-of select="$page.output.body"/> 
     118    </page:output> 
     119  </xsl:template> 
     120  <xsl:template match="page:config"> 
     121    <page:config> 
     122      <page:advice> 
     123        <xsl:apply-templates select="document(resolve-uri(concat($application-root,$page/page:config/@src)))/page:config/page:advice/*" mode="resolve"/> 
     124        <xsl:apply-templates select="page:advice/*"/> 
     125      </page:advice> 
     126    </page:config> 
     127  </xsl:template> 
     128  <xsl:template match="page:head"> 
     129    <page:head> 
     130      <xsl:copy-of select="*"/> 
     131    </page:head> 
     132  </xsl:template> 
     133  <xsl:template match="page:body"> 
     134    <page:body> 
     135      <xsl:apply-templates/> 
     136    </page:body> 
     137  </xsl:template> 
     138  <xsl:template match="body:onload|body:onresize|body:onunload|head:include|head:title|head:link|body:layout"> 
     139    <xsl:element name="{name()}"> 
     140      <xsl:copy-of select="@*"/> 
     141      <xsl:apply-templates/> 
     142    </xsl:element> 
     143  </xsl:template> 
     144  <xsl:template name="resolve-uri"> 
     145    <xsl:param name="href"/> 
     146    <xsl:call-template name="replace"> 
     147      <xsl:with-param name="string" select="translate($href, ' ', '')"/> 
     148    </xsl:call-template> 
     149  </xsl:template> 
     150  <xsl:template match="advice:*" mode="resolve"> 
     151    <xsl:element name="{name()}"> 
     152      <xsl:copy-of select="@*"/> 
     153      <xsl:call-template name="replace"> 
     154        <xsl:with-param name="string" select="."/> 
     155      </xsl:call-template> 
     156    </xsl:element> 
     157  </xsl:template> 
     158  <xsl:template match="advice:*"> 
     159    <xsl:copy-of select="."/> 
     160  </xsl:template> 
     161  <xsl:template match="session:*"> 
     162    <xsl:copy-of select="."/> 
     163  </xsl:template> 
     164  <xsl:template match="geo:map"> 
     165    <xsl:copy-of select="."/> 
     166  </xsl:template> 
     167  <xsl:template match="geo:location"> 
     168    <xsl:copy-of select="."/> 
     169  </xsl:template> 
     170  <xsl:template match="doc:*"> 
     171    <xsl:copy-of select="."/> 
     172  </xsl:template> 
     173  <xsl:template match="*" mode="message"> 
     174    <xsl:element name="{name()}"> 
     175      <xsl:copy-of select="@*"/> 
     176      <xsl:apply-templates/> 
     177    </xsl:element> 
     178  </xsl:template> 
     179  <xsl:template match="view:module[@src]|view:item[@src]"> 
     180    <xsl:apply-templates select="document(resolve-uri(concat($application-root,@src)))"/> 
     181  </xsl:template> 
     182  <xsl:template match="page:*|view:*|page:heading"> 
     183    <xsl:element name="{name()}"> 
     184      <xsl:copy-of select="@*"/> 
     185      <xsl:apply-templates/> 
     186    </xsl:element> 
     187  </xsl:template> 
     188  <xsl:template match="*"> 
     189    <xsl:element name="{local-name()}"> 
     190      <xsl:apply-templates select="@*"/> 
     191      <xsl:apply-templates/> 
     192    </xsl:element> 
     193  </xsl:template> 
     194  <xsl:template match="@*"> 
     195    <xsl:attribute name="{local-name()}"> 
     196      <xsl:call-template name="replace"> 
     197        <xsl:with-param name="string" select="."/> 
     198      </xsl:call-template> 
     199    </xsl:attribute> 
     200  </xsl:template> 
     201  <xsl:template match="text()"> 
     202    <xsl:call-template name="replace"> 
     203      <xsl:with-param name="string" select="."/> 
     204    </xsl:call-template> 
     205  </xsl:template> 
     206  <xsl:template name="replace"> 
     207    <xsl:param name="string"/> 
     208    <xsl:variable name="nString"> 
     209      <xsl:call-template name="cond"> 
     210        <xsl:with-param name="string" select="$string"/> 
     211      </xsl:call-template> 
     212    </xsl:variable> 
     213    <xsl:choose> 
     214      <xsl:when test="contains($nString, $closure-token-pre-delimiter)"> 
     215        <xsl:variable name="name" select="substring-before(substring-before(substring-after($nString, $closure-token-pre-delimiter), $closure-token-post-delimiter), $parameter-list-pre-delimiter)"/> 
     216        <xsl:call-template name="replace-vars"> 
     217          <xsl:with-param name="value-string" select="substring-before(substring-after($nString, $parameter-list-pre-delimiter), $parameter-list-post-delimiter)"/> 
     218          <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)"/> 
     219        </xsl:call-template> 
     220      </xsl:when> 
     221      <xsl:when test="contains($nString, $replace-token-pre-delimiter)"> 
     222        <xsl:variable name="name" select="substring-before(substring-after($nString, $replace-token-pre-delimiter), $replace-token-pre-delimiter)"/> 
     223        <xsl:variable name="replace-with"> 
     224          <xsl:apply-templates select="$advice/advice:*[local-name() = $name]"/> 
     225        </xsl:variable> 
     226        <xsl:call-template name="replace"> 
     227          <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)))"/> 
     228        </xsl:call-template> 
     229      </xsl:when> 
     230      <xsl:otherwise> 
     231        <xsl:value-of select="$nString"/> 
     232      </xsl:otherwise> 
     233    </xsl:choose> 
     234  </xsl:template> 
     235  <xsl:template name="cond"> 
     236    <xsl:param name="string"/> 
     237    <xsl:choose> 
     238      <xsl:when test="contains($string, $cond-token-pre-delimiter)"> 
     239        <xsl:variable name="sString" select="translate($string, ' ', '')"/> 
     240        <xsl:variable name="conditional" select="substring-before(substring-after($sString, $cond-token-pre-delimiter), $cond-token-post-delimiter)"/> 
     241        <xsl:variable name="pre-cond" select="substring-before($sString, $cond-token-pre-delimiter)"/> 
     242        <xsl:variable name="post-cond" select="substring-after($sString, $cond-token-post-delimiter)"/> 
     243        <xsl:variable name="if" select="substring-before(substring-after($conditional, $cond-if-token), $cond-then-token)"/> 
     244        <xsl:variable name="then" select="substring-before(substring-after($conditional, $cond-then-token), $cond-else-token)"/> 
     245        <xsl:variable name="else" select="substring-after($conditional, $cond-else-token)"/> 
     246        <xsl:variable name="nString"> 
     247          <xsl:choose> 
     248            <xsl:when test="$advice/advice:*[local-name() = substring-before(substring-after($if, '@@'), '@@')]"> 
     249              <xsl:variable name="replace-string"> 
     250                <xsl:call-template name="replace"> 
     251                  <xsl:with-param name="string" select="$then"/> 
     252                </xsl:call-template> 
     253              </xsl:variable> 
     254              <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
     255            </xsl:when> 
     256            <xsl:otherwise> 
     257              <xsl:variable name="replace-string"> 
     258                <xsl:call-template name="replace"> 
     259                  <xsl:with-param name="string" select="$else"/> 
     260                </xsl:call-template> 
     261              </xsl:variable> 
     262              <xsl:value-of select="concat($pre-cond, $replace-string, $post-cond)"/> 
     263            </xsl:otherwise> 
     264          </xsl:choose> 
     265        </xsl:variable> 
     266        <xsl:call-template name="cond"> 
     267          <xsl:with-param name="string" select="$nString"/> 
     268        </xsl:call-template> 
     269      </xsl:when> 
     270      <xsl:otherwise> 
     271        <xsl:value-of select="$string"/> 
     272      </xsl:otherwise> 
     273    </xsl:choose> 
     274  </xsl:template> 
     275  <xsl:template name="replace-vars"> 
     276    <xsl:param name="value-string"/> 
     277    <xsl:param name="replace-var-string"/> 
     278    <xsl:variable name="nValue-string"> 
     279      <xsl:call-template name="replace"> 
     280        <xsl:with-param name="string" select="$value-string"/> 
     281      </xsl:call-template> 
     282    </xsl:variable> 
     283    <xsl:variable name="nReplace-var-string"> 
     284      <xsl:call-template name="replace"> 
     285        <xsl:with-param name="string" select="$replace-var-string"/> 
     286      </xsl:call-template> 
     287    </xsl:variable> 
     288    <xsl:variable name="name" select="substring-before(substring-after($nValue-string, $parameter-pre-delimiter), $parameter-post-delimiter)"/> 
     289    <xsl:variable name="value" select="substring-before(substring-after($nValue-string, concat($parameter-value-assigment-token, $sq)), $sq)"/> 
     290    <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)))"/> 
     291    <xsl:variable name="next" select="substring-after($nValue-string, $parameter-list-delimeter)"/> 
     292    <xsl:choose> 
     293      <xsl:when test="$next"> 
     294        <xsl:call-template name="replace-vars"> 
     295          <xsl:with-param name="value-string" select="$next"/> 
     296          <xsl:with-param name="replace-var-string" select="$evaluated-value"/> 
     297        </xsl:call-template> 
     298      </xsl:when> 
     299      <xsl:otherwise> 
     300        <xsl:value-of select="$evaluated-value"/> 
     301      </xsl:otherwise> 
     302    </xsl:choose> 
     303  </xsl:template> 
    299304</xsl:stylesheet> 
  • trunk/nuxleus/Web/4lessig.org/service/transform/controller/atomictalk/base.xslt

    r4599 r4624  
    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="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"> 
     9<xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:debug="http://nuxleus.com/session/debug" 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="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"> 
    1010 
    1111  <xsl:import href="../base.xslt"/> 
     
    105105    </my:session> 
    106106  </xsl:template> 
     107 
     108  <xsl:template match="debug:info"> 
     109    <xsl:copy-of select="."/> 
     110  </xsl:template> 
     111   
     112  <xsl:template match="geo:*"> 
     113    <xsl:copy-of select="."/> 
     114  </xsl:template> 
     115   
    107116  <xsl:template match="my:page"> 
    108117    <my:page>