XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 10th, 2004, 12:02 AM
Rogelio Rogelio is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 104 Rogelio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 43 m 32 sec
Reputation Power: 6
Send a message via AIM to Rogelio
simple XML/XSD debug help please...

heres number3.xsd
Code:
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
<xsd:element name="MOVIEDETAILS"/>
<xsd:element name="MOVIE"/>
<xsd:element name="TITLE" type ="xsd:string"/>

<xsd:element name="MOVIEID" type="MOVIEIDNO"/>

<xsd:simpleType name ="MOVIEIDNO">
<xsd:restriction base = "xsd:string">
<xsd:length value="4"/>
<xsd:pattern value = "M{3}"/>

</xsd:restriction>
</xsd:simpleType>

<xsd:element name="DIRNAME" type ="xsd:string"/>
<xsd:element name="CAST" type ="xsd:string"/>
<xsd:element name="YEAROFRELEASE" type ="xsd:positiveInteger"/>
</xsd:schema>


here is the number3.xml
Code:
<?xml version = "1.0"?>
<MOVIEDETAILS>
	<MOVIE>
	<TITLE>THE SIXTH SENSE</TITLE>
	<MOVIEID>M876</MOVIEID>
	<DIRNAME>M Night Shyamalan</DIRNAME>
	<CAST>BRUCE WILLIS, HALEY JOEL OSMENT</CAST>
	<YEAROFRELEASE>1999</YEAROFRELEASE>
	</MOVIE>
</MOVIEDETAILS>



Okay what i want it to do, is that when you enter the movie ID, it has to start with an M and then accept the other 3 numbers for the movie ID.. but ikeep getting the error

Error URL:
file:///Z:/webweek8/number3.xml
Error Line:
5
Error Position:
17
Error Reason:
Pattern constraint failed. The element: 'MOVIEID' has an invalid value according to its data type

//why is this?? im going nuts!! thanks in advance...

Reply With Quote
  #2  
Old August 10th, 2004, 07:51 AM
RRG RRG is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 11 RRG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
pattern

Try \d to tell u want 3 digits]

Reply With Quote
  #3  
Old August 10th, 2004, 07:56 AM
RRG RRG is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 11 RRG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML , XSL, XSD kindly help me get some output please

Hi: Do you know if we need to comment you reference line to XSD file in the XML to get output using XSL transformations?

I am sleepless with my assignment that nees to be done this friday and am unable to fix it at all...here is my XML and XSL file:I am trying to output some child elements / @ out of Customer and Product elelmtns but had to design them alternately in xml for schema to validate against the xml fiiles. My qs is does schema interfere with xsl ?
Can you kindly help me pleaseeeeeee by ths Thursday ?
<Bank xmlns='http://xml.XMLCourse.edu/targetNS'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://xml.XMLCourse.edu/targetNS HW3Schema.xsd'>


<Customer Code="001" Name="Arup Ray" City="Kolkata">
<!--<Account Code="001"/>
<Account Code="002"/>-->

<SSN>001-44-8888</SSN>
<Gender>Male</Gender>
<State>WB</State>
<Country>India</Country>
<AccBal>35000.00</AccBal>
<Dep>250.00</Dep>
<Dep>375.00</Dep>
<Wdl>50.00</Wdl>
<Wdl>25.00</Wdl>
<localCurrency>INR</localCurrency>
<exchangeRate>45</exchangeRate>

</Customer>


<Product ID="001" Name="Checking">


<MinBal>500.00</MinBal>
<Int>.20</Int>
<Fees>2.00</Fees>


</Product>


<Customer Code="003" Name="Paula Smith" City="Boston">
<!-- <Account Code="003"/>
<Account Code="004"/>-->

<SSN>001-22-1111</SSN>
<Gender>Female</Gender>
<State>MA</State>
<Country>USA</Country>
<AccBal>15000.00</AccBal>
<Dep>100.00</Dep>
<Dep>50.00</Dep>
<Wdl>20.00</Wdl>
<Wdl>40.00</Wdl>

</Customer>


<Product ID="002" Name="Savings">



<MinBal>5000.00</MinBal>
<Int>.20</Int>
<Fees>3.00</Fees>

</Product>

<Customer Code="002" Name="Robin Kidman" City="Cambridge">
<!--<Account Code="002"/>
<Account Code="001"/>--> <!--Customer can have 0 or more accounts-->
<SSN>001-55-7777</SSN>
<Gender>Female</Gender>
<State>BH</State>
<Country>UK</Country>
<AccBal>8000.00</AccBal>
<Dep>250.00</Dep>
<Wdl>50.00</Wdl>
<localCurrency>GBP</localCurrency>
<exchangeRate>1.5</exchangeRate>


</Customer>

<Product ID="003" Name="CD">



<MinBal>10000.00</MinBal>
<Int>.20</Int>
<Fees>4.00</Fees>


</Product>

<Customer Code="002" Name="Chris Shaw" City="Atlanta" >
<!--<Account Code="002"/>
<Account Code="003/> -->

<SSN>001-11-5234</SSN>
<Gender>Male</Gender>
<State>GA</State>
<Country>USA</Country>
<AccBal>40000.00</AccBal>
<Dep>300.00</Dep>
<Wdl>100.00</Wdl>

</Customer>


<Product ID="004" Name="IRA">



<MinBal>20000.00</MinBal>
<Int>.20</Int>
<Fees>5.00</Fees>


</Product>


</Bank>
***************************

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">


<xsl:template match="/">

<html>
<body>
<h3>Display International Customers</h3>
<table border="1">
<tr bgcolor="#9acd32">
<th>Country</th>
<th>USD Balance</th>


</tr>

</table>
</body>
</html>

<!-- DISPLAY ALL INTERNATIONAL CUSTOMERS-->
<!--<xsl:for-each select="Customers/Customer[@Country='India']"> -->

<!-- <xsl:for-each select="Customer[(Country='India')]" > -->




<!-- <xsl:variable name="Bal" select="AccBal"/> -->
<!-- <xsl:variable name="ER" select="exchangeRate"/>-->
<!-- <xsl:variable name="Value" select="($Bal * $ER)"/>

Bank/Customer[position() mod 2 = 1]-->

<xsl:if test="Customer[position()= 1]" >
<!--<xsl:if test="position() mod 2 = 1">-->


<tr>
<!--<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@City"/></td>-->
<td><xsl:value-of select="Country"/></td>
<td><xsl:value-of select="AccBal"/></td>
</tr>

</xsl:if>



</xsl:template>




</xsl:stylesheet>


<!--Display Month end Balances for all customers:ON THE FLY DATA

<table border="1">
<tr><i>Display Month-end Balances for all customers</i></tr>
<tr bgcolor="salmon">

<th>Code</th>
<th>Balance</th>
<th>Deposits</th>
<th>Withdrawals</th>
<th>MonthEnd</th>



</tr>
<apply-templates select="Customer" />
Month End Calculations

<xsl:for-each select="Customer">


<xsl:variable name="Deposits" select="sum(Dep)"/>
<xsl:variable name="Wdl" select="sum(Wdl)"/>

<xsl:variable name="Monthly" select="($Balance + $Deposits) - ($Wdl)"/>


<tr>

<td><xsl:value-of select="@Code"/></td>
<td><xsl:value-of select="AccBal"/></td>
<td><xsl:value-of select="sum(Dep)"/></td>
<td><xsl:value-of select= "sum(Wdl)"/></td>
<td><xsl:value-of select= "$Monthly"/></td>

</tr>

</xsl:for-each>
</table>

</body>
</html>
</xsl:template>


</xsl:stylesheet>-->

Reply With Quote
  #4  
Old August 10th, 2004, 09:39 AM
RRG RRG is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 11 RRG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apply template / template match

If you kindly look at my XML and XSL file pasted in another message her, I just cannot understand how to use apply-templates and template-match to choose the correct node-sets.
Please please help me.Before this thursday AUg 12,2004.

Thanks!!!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > simple XML/XSD debug help please...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT