OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] how to design an HTML file to contain an XML file?

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Re: [xml-dev] how to design an HTML file to contain an XML file?
  • From: Tei <oscar.vives@gmail.com>
  • Date: Wed, 26 Jul 2006 10:24:12 +0200
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AtcIS46pXtFrOjbSWv9J8KpKdR/fwZ8VtaSOItBmlfWavcq/I8urLieWu44weU/k1P0VJhViUnZznnSLlsPw1mryXKo3XdHz1KKPemu1T6WCoKToyEqwQVya8d+3zHG9BHQopvnDbQb55iDPpDvbNr4ySuz7naNfJ5VX/pEJmLk=
  • In-reply-to: <20060726033807.37483.qmail@web52701.mail.yahoo.com>
  • References: <75cb920c0606211301r3e9a8eafue4d5f5f001ed87ff@mail.gmail.com> <20060726033807.37483.qmail@web52701.mail.yahoo.com>

On 7/26/06, Anil Philip <goodnewsforyou@yahoo.com> wrote:
>
> "put the XML in the XHTML head element, so that it won't be displayed"
>
> Unfortunately, this does not seem to work.
>
> When I do it and view the html page in the browser, I see at the top:
> 0 11 olathe weather 1.1 21.0 true 11 8 22.1 14.699999 true 19 26 36.8 19.8
> true 45 15 56.6 21.800003 true 60 12
>
> This is the data in the XML tags.
>
> The header of my XHTML file is:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html>
> <head>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <JWO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="C:\Projects\ACD\jwo_schema01.xsd">
>
>  Any help appreciated.
> No, in time, I think you will be happy to see another useful and innovative
> XML application on the Web.
> http://juwo.com

Move the <?xml version="1.0" encoding="ISO-8859-1"?> to the first line.

Is wrong because you dont mix two namespaces (XHTML and XSI), but you
embed one file into another. The resulting file Is not  valid xml.

Heres is a example that mix MathML and other stuff on XHTML:
http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020430/sample.xhtml

I am still learning XML, so _this can be wrong_, but maybe you can do that:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>
<head>
<meta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="C:\Projects\ACD\jwo_schema01.xsd">
  <xsi:your data/>
  <xsi:your data/>
  <xsi:your data/>
</meta>
</head>
...

Because you are working with XML, I thing you sould validate your
files to debug it.

If you are working with XHTML files, you sould care about the mime
content type your server declare. Theres wildly different rules for
text/html and application/xhtml+xml even if the XHTML code dont
change:
http://hixie.ch/advocacy/xhtml

Unfortunally IE6 is broken and dont support application/xhtml+xml yet.
I suggest defensive programming here.


--Tei


postdata0:
If you use SVN, you can automatically validate the uploaded files
(with a post-commit script).

postdata1:
Unrelated comment: I am curious about Firefox. I have read somewhere
that you can concatenate two XML files on this browser. Somewhere on
the xulplanet comments...

postada2:
And now a unrelated snip of code:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xmlspec.xsl'?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN" "xmlspec.dtd"[
<!ENTITY % entities SYSTEM "entitieswd.dtd" >
<!ENTITY wgmb SYSTEM "wgmb.txt" >
<!ENTITY prevwgmb SYSTEM "prevwgmb.txt" >
%entities;
<!ENTITY status "editors' copy">
]>
<spec w3c-doctype="rec" role="edcopy">
  <header>
    <title>SOAP Version 1.2 Part 1: Messaging Framework</title>

I found a fascinathing hack^H^Hfeature the use of wgmb to include a file.
So much to learn with XML! :D

postdata3:
This is interesting because is more modular. The data is not embeded
into the file (wgmb.txt).
You are triing to embed data, I know. But maybe you are wrong and is a
bad idea  (:

postdata4:
Also I guest is better to use UTF8 than iso-8859-1, so you can mix
north europe stuff with english, japan, israel, etc..




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS