Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 30th, 2012, 09:31 AM
Registered User
Points: 86, Level: 1
Points: 86, Level: 1 Points: 86, Level: 1 Points: 86, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2012
Location: London
Posts: 20
Thanks: 12
Thanked 0 Times in 0 Posts
Default Object oriented schema!

Mmm, this one is quite hard to explain (or maybe its just me) so I hope this means something to you.

Is it possible to implement a C++/Java class type structure in XML / XSD?
public class Pump
	private decimal minFlowRate = 2, maxFlowRate = 9.3;
	private int maxRuntime = 4800 ;
	private string name ;
So I can create a distinct collection of pumps in such a way that I can use the pump's name either as an attribute's value, or an an attribute itself within an XML document, and use the other information like the min and max flowrates to apply constraints.

So for brevity let's assume I have 100 pumps and they're called P001 to P100. I would like a schema to be able to say :
<pump name="P024" flowRate="20.2" runTime="234" ... />
<pump name="P044" flowRate="7.89" runTime="1" ... />
is valid as is :
<flowRates P1024="34" P1044="22.2" ... />
<runTime P1024="234" P1044="77" ... />
I would also like to apply constraints on these pumps in a similar manner. For example I want to ensure that the pump hasn't been running for more the X hours. This X value being different for each pump.

So if this :
<pump name="P024" flowRate="20.2" runTime="234" .../>
<pump name="P033" flowRate="5.0" runTime="77" ... />
appears in the XML my application can check using the schema that P033 only has 3 more hours of continuous running time remaining, but P024 is good for another 66.

Or do I need to wake up?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Oriented Programming jgrant C# 2005 0 March 16th, 2007 03:04 AM
Is C# fully object oriented ? akkad C# 1 July 2nd, 2006 01:44 PM
Object oriented ASP. madhukp Classic ASP Basics 10 July 2nd, 2004 09:43 AM
Object oriented programming with VB6 james gold Pro VB 6 3 September 27th, 2003 02:31 PM
Object oriented programming with VB6 james gold VB How-To 2 September 23rd, 2003 09:29 AM

All times are GMT -4. The time now is 10:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.