[xquery-talk] Serialize xml to html5 with php.

France Baril france.baril at architextus.com
Wed Dec 10 15:09:40 PST 2014


Hi, solution #2 was the best option.

#1 was not an option in our context and #3 did not work in every browser.

On Thu, Nov 27, 2014 at 10:00 AM, Michael Seiferle <ms at basex.org> wrote:

> Hi France,
>
>
> I started toying around, here are three more or less pragmatic approaches
> :-)
>
> Are you required to use html(5) serialization? From what I understand
> processing instructions in HTML are serialized differently, '?>' serializes
> to '>':
> http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.3.6
> (there may be a better source for this behavior, but this is what I found).
>
> In case you are not, you could work around this using xhtml serialization:
>
>> declare option output:method "xhtml";
>>
>> <x>
>> <?php print "Hi"  ?>
>> <input/>
>> </x>
>>
>
> or alternatively add an extra '?':
>
>> declare option output:method "html";
>> declare option output:html-version "5.0";
>>
>> <x>
>> <?php haha  ??>
>> <input/>
>> </x>
>>
>
> or you could make use of PHPs script syntax: http://php.net/manual/en/
> language.basic-syntax.phpmode.php
>
>  <script language="php">
>>     echo 'some editors (like FrontPage) don\'t
>>          like processing instructions';
>> </script>
>>
>
> Best
>
> Michael
>
>
> On 27 Nov 2014, at 16:33, France Baril wrote:
>
>  Hi,
>>
>> I was trying to use BaseX to export files that contain some php code, and
>> after xml to html5 serialization  <?php ... ?> becomes <?php ...>.
>>
>> They suggested I contact this list to enquire about any option to export
>> the php with the closing '?'?
>>
>>
>> --
>> France Baril
>> Architecte documentaire / Documentation architect
>> france.baril at architextus.com
>> _______________________________________________
>> talk at x-query.com
>> http://x-query.com/mailman/listinfo/talk
>>
>


-- 
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20141210/20172a78/attachment.html>


More information about the talk mailing list