Formattings in XML Document!

Hello Bob,

thank you for your Answer. I'll try to use this Ibm's Tool for this problem. But I want to ask, how can I HTML-elements without defining these in my primary schema? I know there is a W3C-DTD of xhtml elements. Can I only include this DTD into my schema or define his namespace and to use the elements? See the documents describing my problem:

Schema:
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="kurztext">
		<xs:complexType mixed="true"/>								
	</xs:element>
	<xs:element name="root">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="kurztext" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>	
</xs:schema>


XML:
<?xml version="1.0" encoding="UTF-16"?>
<?xml-stylesheet type="text/xsl" href="E:\gaebforum\formatierung_text(1).xsl"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="E:\formatierung_text\formatierung_text(1).xsd">
	<kurztext>
			Dies ist ein Text mit 
			<b>fetten</b> 
			und hohen 
			<sup>2</sup> 
			Elementen E<sub>B</sub>.
	</kurztext>
	<kurztext>
			Dies ist ein Text mit Objekt
			<sub>fetten</sub> 
			und Fläche 12m
			<sup>2</sup> und
			<b>Elementen</b>
	</kurztext>
</root>


XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>

<xsl:template match="root">
<html>
<body>
<p> <xsl:for-each select="kurztext">
    <xsl:apply-templates/>
 </xsl:for-each>
</p>
</body>
</html>
</xsl:template>

<xsl:template match="sup">
   <sup><xsl:value-of select="."/></sup>
</xsl:template>

<xsl:template match="sub">
   <sub><xsl:value-of select="."/></sub>
</xsl:template>

<xsl:template match="b">
   <b><xsl:value-of select="."/></b>
</xsl:template>
</xsl:stylesheet>


Ideas are wilkommen!!


Santos



"Bob Schloss" <rschloss@us.ibm.com> schrieb am 14.02.02:
> Santos,
> 
> You have to use namespace prefixing in the instance document.
> For instance:
> <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="E:
> \formatierung_text\formatierung_text(3).xsd"
> xmlns:m="http:////www.w3.org/1998/Math/MathML">
>  <TexT>
>   <m:mrow>
>    <m:msup>
>     <m:mfenced>
>      <m:mrow>
>       <m:mi>a</mi>
>       <m:mo>+</mo>
>       <m:mi>b</mi>
>      </m:mrow>
>     </m:mfenced>
>     <m:mn>2</mn>
>    </m:msup>
>   </m:mrow>
>  </TexT>
>  <TexT>
>    This is an exercice:
>    <m:mrow>
>    <m:msup>
>     <m:mfenced>
>      <m:mrow>
>       <m:mi>a</mi>
>       <m:mo>+</mo>
>       <m:mi>b</mi>
>      </m:mrow>
>     </m:mfenced>
>     <m:mn>2</mn>
>    </m:msup>
>   </m:mrow>
>  </TexT>
> </root>
> 
>  You cannot get the formatting using the simple XSL file you are given.
>  You are going to need a MathML renderer.  For instance:
>  http://www.ibm.com/software/network/techexplorer/
> 
>  Bob
> 
> 
> 
> 
> mogot@web.de on 02/14/2002 04:42:27 AM
> 
> To:    Bob Schloss/Watson/IBM@IBMUS
> cc:
> Subject:    Re: Re: Formattings in XML Document!
> 
> 
> 
> "Bob Schloss" <rschloss@us.ibm.com> schrieb am 13.02.02:
> > Besides declaring the namespaces of MathML and/or XHTML in your schemas,
> > you may want to define your own complexType for the content of element
> TexT
> > in which you include wildcard particles, such as
> >  <xs:any namespace="http://www.w3.org/1998/Math/MathML" processContents
> > ="skip" minOccurs="0"/>
> > (you could use processContents="lax").
> >
> > Please see these sections of the Schema spec:
> > http://www.w3.org/TR/xmlschema-1/#Wildcards
> > http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definitions
> >
> > I think it would be nice to have a fuller explanation of this as a
> question
> > in the XML Schema FAQ:
> > http://www.schemavalid.com/faq/xml-schema.html
> >
> >             Good luck,
> >             Bob
> >
> >
> >
> > mogot@web.de@w3.org on 02/13/2002 05:22:05 AM
> >
> > Sent by:    xmlschema-dev-request@w3.org
> >
> >
> > To:    xmlschema-dev@w3.org
> > cc:
> > Subject:    Formattings in XML Document!
> >
> >
> >
> > Hello people,
> >
> > I defined the structure of a document in a schema. In generated XML
> > documents  I would like to apply the formatting as bold, turned up ,
> turned
> > down and to apply mathematical signs without defining the needed signs in
> > my schema for that.
> >
> > The formatting and additional characters are supposed to occur per
> example
> > in a element <TexT> ..</TexT>. This element was defined as string in the
> > schema. Is it possible that I only declare the Namespaces of MathML
> > (Mathematical Markup Language) and xhtml to include the W3C schemas of
> > these elements (as <mrow>..</mrow> <mn>..</mn> and <sup>..</sup>,
> > <sub>..<sub>) in my primary schema and to use these in the <TexT> element
> > without defining these elements?
> 
> 
> 
> 
> Hi Bob,
> 

____________________________________________________
Berufsunfähigskeitversicherung von Mamax bei WEB.DE. 
Jetzt informieren! http://bu.web.de

Received on Friday, 15 February 2002 09:57:52 UTC