[Yanel-dev] xinclude

Michael Wechner michael.wechner at wyona.com
Fri Jan 6 00:39:28 CET 2012


Hi Balz

Am 03.01.12 17:05, schrieb basZero:
> Hi Michael,
> first of all, happy new year!

the same to you
> I hope you had relaxing days over christmas.

thanks very much, hope you had a nice time as well
>
> I tested a bit further and I am still not able to produce the expected 
> HTML.
>
> So to sum up again, what I want to achieve is this:
> - from XSL A (rendered as text/html) I do an xinclude of XSL B 
> (application/xml)
> - within XSL B, I would like to produce this HTML at the end:
>
> <scripttype="text/javascript">
> <!-- Hi Michael //-->
> </script>
>
> While this can easily be achieved without using an xinclude (e.g. by 
> directly producing it in XSL A), I always end up in encoded characters:
> HTML looks like this:
>
> <script type="text/javascript">
> <!-- Hi Michael //-->
> </script>
>
> In XSL B, I tried many combinations, like:
>
> <script type="text/javascript">
> <![CDATA[<!--  Hi Michael //-->]]>
> </script>
>
> or
>
> <script type="text/javascript">
> <!--  Hi Michael //-->
> </script>
>
> I currently think that it is impossible to produce the expected HTML 
> if application/xml has been chosen as mime type of the resource 
> rendering XSL B.

thanks for describing the issue. I will try to reproduce what you 
describe above and give you some feedback as soon as possible.

Thanks

Michael
>
> Maybe you have further thoughts about this, I'll try to implement a 
> workaround.
> Cheers
> Balz
>
>
> On Fri, Dec 23, 2011 at 1:38 PM, Michael Wechner 
> <michael.wechner at wyona.com <mailto:michael.wechner at wyona.com>> wrote:
>
>     Dear Balz
>
>     Am 23.12.11 10:16, schrieb basZero:
>>     Dear Michael,
>>     thanks for your reply.
>>     The scenario I was laying out is as follows:
>>     you have a page (served resource A) using the global.xsl.
>>     Resource A is configured to produce text/html at the end (mime
>>     property in yanel-rc).
>>
>>     In any XSL, executed in the context of resource A, I am able to
>>     produce this kind of HTML:
>>     <scripttype="text/javascript"><!--
>>     google_ad_client ="ca-pub-4234093452213266";
>>     /* Right Sidebar */
>>     google_ad_slot ="1819825771";
>>     google_ad_width =160;
>>     google_ad_height =600;
>>     //-->
>>     </script>
>>
>>     Every new line and every single character must exactly look like
>>     this in the resulting HTML (that's the rule given by Google
>>     AdSense, can't change that).
>>
>>     But when I want to produce that HTML in a resource configured
>>     with mimetype xhtml (like the header or the sidebar), It can not
>>     be rendered like that (because it's not XHTML)...
>
>     I think the above script snippet is well-formed (at least when
>     using xmllint).
>
>     Maybe you have to add <?xml version="1.0"?> and include it as
>     application/xml, whereas the page including the above
>     then can be serialized as text/html
>
>>
>>
>>     So this is how I came to the question, why can I not run the
>>     Header and Sidebar resource with mime type text/html :)
>>
>>     However, I can also embed the code in an XSL that is used by a
>>     text/html resource, so It will work, I just wondered, whether
>>     somebody knows...
>>
>>     If you have an idea, let me know.
>>
>>     Merry Christmas to you Michael and all others listening on this list!
>
>     Very merry christmas to you and everybody else as well :-)
>
>     Michael
>
>>
>>     Gruess
>>     Balz
>>
>>     On Fri, Dec 23, 2011 at 5:58 AM, Michael Wechner
>>     <michael.wechner at wyona.com <mailto:michael.wechner at wyona.com>> wrote:
>>
>>         Am 22.12.11 16:49, schrieb basZero:
>>>         dear all,
>>>
>>>         I have a general question:
>>>
>>>         usually the menu gets included via xinclude from the global XSL:
>>>
>>>         e.g.:
>>>
>>>         <xi:include
>>>         href="yanelresource:/de/header.yanel?path={$yanel.path}"/>
>>>
>>>
>>>         it seems that the resource serving the content for that
>>>         included content must deliver content in mime type
>>>         "application/xhtml+xml".
>>>         when changing it into "text/html" it throws many exceptions
>>>         in the log.
>>
>>         yes, because it's not considered to be well-formed
>>
>>>
>>>         does anybody have used includes with "text/html" content?
>>
>>         why do you want to include something inside XML/XHTML, which
>>         might not be XML/XHTML?
>>
>>         Or otherwise you might want to consider to use CDATA, but I
>>         guess then you would have to use something
>>         different than xi:include, because I would assume that
>>         XInclude would always require some well-formed XML/XHTML per
>>         definition.
>>
>>         HTH
>>
>>         Michael
>>>
>>>         Thanks
>>>         cheers
>>>         Balz
>>>
>>>
>>
>>
>>         --
>>         Yanel-development mailing list Yanel-development at wyona.com
>>         <mailto:Yanel-development at wyona.com>
>>         http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>
>>
>>
>>
>
>
>     --
>     Yanel-development mailing list Yanel-development at wyona.com
>     <mailto:Yanel-development at wyona.com>
>     http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20120106/0089a7ca/attachment-0001.html>


More information about the Yanel-development mailing list