<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - XML</title>
		<link>http://p2p.wrox.com</link>
		<description>General XML discussions.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 20:41:29 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - XML</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>XML Translation</title>
			<link>http://p2p.wrox.com/xml/76935-xml-translation.html</link>
			<pubDate>Fri, 06 Nov 2009 20:47:40 GMT</pubDate>
			<description>I load with AJAX this XML (apps.xml) which is translated (//menu/@name and app/@name) in english:

Every menu or app element has a big depth of...</description>
			<content:encoded><![CDATA[<div>I load with AJAX this XML (apps.xml) which is translated (//menu/@name and app/@name) in english:<br />
<br />
Every menu or app element has a big depth of hierarchy but here I omit it.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />
<br />
&lt;menu name=&quot;Main Menu&quot; path=&quot;&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;menu name=&quot;Menu #1&quot; path=&quot;classification&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;app name=&quot;Application #1&quot; path=&quot;vehicle&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;app name=&quot;Application #2&quot; path=&quot;bridge&quot; need=&quot;vehicle&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/menu&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;menu name=&quot;Menu #2&quot; path=&quot;demolitions&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;menu name=&quot;Menu #3&quot; path=&quot;minefield&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;menu name=&quot;Menu #4&quot; path=&quot;river_cross_op&quot; /&gt;<br />
&lt;/menu&gt;</code><hr />
</div>I want to translate this XML to many languages with these permissions:<br />
- Only these elements must be translated //menu/@name and //app/@name<br />
- Do not clone XML and translate it. It isn't a big waste of size, but I don't want to make a change to all XMLs<br />
- Translations must be in separated files. Not all translations in the same file.<br />
<br />
Any directions? I can change the whole structure of XML, if you want. No limits.<br />
<br />
My thoughts:<br />
<br />
- Convert all XMLs to PHPs and use gettext like this:<br />
   &lt;menu name=&quot;&lt;?=_('Menu #2')?&gt;&quot; path=&quot;demolitions&quot; /&gt;<br />
- instead of loading e.g. apps.xml load translator.php?apps.xml (use very tricky code to translate with gettext, elements //menu/@name and //app/@name)<br />
- Use apps.xml with apps.french.xml included and change elements //menu/@name and //app/@name with translator.xsl.<br />
apps.french.xml here:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />
<br />
&lt;translations&gt;<br />
&lt;translation name=&quot;Main Menu in french&quot; path=&quot;&quot;&gt;<br />
&lt;translation name=&quot;Menu #1 in french&quot; path=&quot;classification&quot;&gt;<br />
&lt;translation name=&quot;Application #1 in french&quot; path=&quot;vehicle&quot; /&gt;<br />
&lt;translation name=&quot;Application #2 in french&quot; path=&quot;bridge&quot; /&gt;<br />
&lt;translation name=&quot;Menu #2 in french&quot; path=&quot;demolitions&quot; /&gt;<br />
&lt;translation name=&quot;Menu #3 in french&quot; path=&quot;minefield&quot; /&gt;<br />
&lt;translation name=&quot;Menu #4 in french&quot; path=&quot;river_cross_op&quot; /&gt;<br />
&lt;/translations&gt;</code><hr />
</div>What do you say?<br />
<br />
Thanks for your time and brain-scratching.</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/xml-91/">XML</category>
			<dc:creator>chameleon</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/xml/76935-xml-translation.html</guid>
		</item>
		<item>
			<title>Problem with XSLT template</title>
			<link>http://p2p.wrox.com/xml/76814-problem-xslt-template.html</link>
			<pubDate>Thu, 29 Oct 2009 17:13:24 GMT</pubDate>
			<description>Hi All,
 
I want to display part of XML using XSLT but its displaying other part of XML document also. below is my code :
 
XML 
 

Code:
---------</description>
			<content:encoded><![CDATA[<div>Hi All,<br />
 <br />
I want to display part of XML using XSLT but its displaying other part of XML document also. below is my code :<br />
 <br />
XML <br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> <br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />
&lt;profile&gt; <br />
&nbsp; &lt;users&gt;<br />
&nbsp;&lt;user&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;firstname&gt;John&lt;/firstname&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;lastname&gt;Won&lt;/lastname&gt;&nbsp; <br />
&nbsp;&lt;/user&gt;<br />
&nbsp; &lt;/users&gt;<br />
&nbsp; &lt;departments&gt;<br />
&nbsp;&lt;department&gt;Sales&lt;/department&gt;<br />
&nbsp;&lt;department&gt;Finance&lt;/department&gt;<br />
&nbsp;&lt;department&gt;Order&lt;/department&gt;<br />
&nbsp;<br />
&nbsp; &lt;departments&gt;<br />
&lt;/profile&gt;</code><hr />
</div>XSLT:<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> <br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />
&lt;xsl:stylesheet xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>&quot; <br />
&nbsp; &nbsp; &nbsp; xmlns:xs=&quot;<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>&quot;<br />
&nbsp; &nbsp; &nbsp; exclude-result-prefixes=&quot;xs&quot;<br />
&nbsp; &nbsp; &nbsp; version=&quot;2.0&quot;&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;xsl:template match=&quot;/&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:apply-templates/&gt;&nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;/xsl:template&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;xsl:template match=&quot;user&quot;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;html&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font size=&quot;5&quot; color=&quot;blue&quot;&gt;&lt;xsl:value-of select=&quot;firstname&quot;&gt;&lt;/xsl:value-of&gt;&lt;/font&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;br/&gt;&lt;br/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xsl:value-of select=&quot;lastname&quot;&gt;&lt;/xsl:value-of&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/html&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</code><hr />
</div>I just want to display users information but it is displaying department as well.<br />
 <br />
How can i just display users information.#<br />
 <br />
Thanks <br />
Nelly</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/xml-91/">XML</category>
			<dc:creator>nelly78</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/xml/76814-problem-xslt-template.html</guid>
		</item>
		<item>
			<title>Problem with using parameter value</title>
			<link>http://p2p.wrox.com/xml/76751-problem-using-parameter-value.html</link>
			<pubDate>Sat, 24 Oct 2009 16:49:18 GMT</pubDate>
			<description><![CDATA[Hi All,

 I am using string value as parameter in Xpath but its not treating as as single string.

My code is :

Code:
---------
<xsl:param...]]></description>
			<content:encoded><![CDATA[<div>Hi All,<br />
<br />
 I am using string value as parameter in Xpath but its not treating as as single string.<br />
<br />
My code is :<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;xsl:param name=&quot;region&quot;&gt;&lt;/xsl:param&gt;<br />
<br />
&lt;xsl:value-of select=&quot;/presentation/newssheet[@region=$region]&quot;&gt;&lt;/xsl:value-of&gt;</code><hr />
</div>in parameter i am passing value say 'Middle east'<br />
<br />
what is doing its bringing other value as well from the xml document like<br />
<br />
'far east'. If i pass this without parameter as  <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;xsl:value-of select=&quot;/presentation/newssheet[@region='Middle east']&quot;&gt;&lt;/xsl:value-of&gt;</code><hr />
</div>This i am getting the only middle east content from xml document.<br />
<br />
Can you please tell me how can i pass value of parameter as single string so it should only return the matching value.<br />
<br />
Thanks<br />
<br />
-Hari</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/xml-91/">XML</category>
			<dc:creator>Hari7</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/xml/76751-problem-using-parameter-value.html</guid>
		</item>
		<item>
			<title>Linking the attribute value in XML</title>
			<link>http://p2p.wrox.com/xml/76726-linking-attribute-value-xml.html</link>
			<pubDate>Fri, 23 Oct 2009 13:35:32 GMT</pubDate>
			<description>Hi All,

 I have a Xml document and a Xml Schema document. In xml Schema i have define sum type which i am using to validate XMl Document.

 I  want...</description>
			<content:encoded><![CDATA[<div>Hi All,<br />
<br />
 I have a Xml document and a Xml Schema document. In xml Schema i have define sum type which i am using to validate XMl Document.<br />
<br />
 I  want to link the attribute value with one another. <br />
<br />
 As per the below code i want Regionid and regionType should be linked with each other.<br />
<br />
 For example : In XMl document it should only allow RegionID=&quot;ER&quot; and reion=&quot;Europe and Russia&quot;<br />
<br />
 it should not allow other values with reionID=&quot;ER&quot; and vice versa.<br />
<br />
<br />
 below is the Code of XMl Schema :<br />
<br />
<br />
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<br />
	&lt;xs:element name=&quot;User&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;6&quot;&gt; <br />
           &lt;xs:complexType&gt;<br />
              &lt;xs:attribute name=&quot;region&quot; use=&quot;required&quot; type=&quot;regiontype&quot;/&gt; <br />
	      &lt;xs:attribute name=&quot;regionId&quot; use=&quot;required&quot; type=&quot;regionIdtype&quot;/&gt;<br />
           &lt;/xs:complexType&gt;<br />
        &lt;/xs:element&gt;<br />
&lt;/xs:schema&gt;<br />
	<br />
<br />
 &lt;xs:simpleType name=&quot;regiontype&quot;&gt; <br />
        &lt;xs:restriction base=&quot;xs:NMTOKENS&quot;&gt;<br />
            &lt;xs:enumeration value=&quot;Europe and Russia&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;North America&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;Latin and South America&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;Africa&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;Middle East&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;Far East and Australsia&quot;/&gt;<br />
        &lt;/xs:restriction&gt;<br />
    &lt;/xs:simpleType&gt;<br />
<br />
    &lt;xs:simpleType name=&quot;regionIdtype&quot;&gt; <br />
        &lt;xs:restriction base=&quot;xs:NMTOKEN&quot;&gt;<br />
            &lt;xs:enumeration value=&quot;ER&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;NA&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;LSA&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;AF&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;ME&quot;/&gt;<br />
            &lt;xs:enumeration value=&quot;FEA&quot;/&gt;<br />
        &lt;/xs:restriction&gt;<br />
    &lt;/xs:simpleType&gt;<br />
<br />
<br />
XMl Structure :<br />
===============<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />
 &lt;User regionId=&quot;ER&quot; region=&quot;Europe and Russia&quot;&gt;<br />
<br />
 &lt;/User&gt;<br />
<br />
 How can i achieve this.<br />
<br />
 Thanks<br />
<br />
 -Hari</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/xml-91/">XML</category>
			<dc:creator>Hari7</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/xml/76726-linking-attribute-value-xml.html</guid>
		</item>
		<item>
			<title>Problem with date format in XML and XML Schema</title>
			<link>http://p2p.wrox.com/xml/76724-problem-date-format-xml-xml-schema.html</link>
			<pubDate>Fri, 23 Oct 2009 13:04:48 GMT</pubDate>
			<description>Hi All,
 
I have created Xml Schema file which validate Xml document.In xml document i have a date attribute which i validate thorugh  xsd but the...</description>
			<content:encoded><![CDATA[<div>Hi All,<br />
 <br />
I have created Xml Schema file which validate Xml document.In xml document i have a date attribute which i validate thorugh  xsd but the problem is type xs:date of Xml Schema only allows date format as yyyy/mm/dd.<br />
 <br />
 In my Xml document i want to enter date format as dd/mm/yyyy.<br />
 <br />
Can anyone show me how to achieve this. please provide some example or code.<br />
<br />
 Thanks for your help.<br />
 <br />
 -Nelly</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/xml-91/">XML</category>
			<dc:creator>nelly78</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/xml/76724-problem-date-format-xml-xml-schema.html</guid>
		</item>
	</channel>
</rss>
