|
Hi guys,
I've only ever worked with XML, never really designed, so I'm looking for a little advice. I need to design four request message types (and corresponding replies, but that later). I would like to use a standard enclosing document, with a message type attribute or element that then defines how the recipient must treat the rest of the message. I don't know where to start, what guidelines to use for structure, where attributes and where elements etc. Any advice and tips will be appreciated.
|
|
|
|
|
Try searching for "XML Schema Best Practices".
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Brady Kelly wrote: I don't know where to start
Representing data in XML is not that far removed from traditional programming. Design your data just as you would in a C structure. Now that structure can be mostly mirrored in XML.
Brady Kelly wrote: I would like to use a standard enclosing document, with a message type attribute or element that then defines how the recipient must treat the rest of the message
Take a look at the high level design of SOAP.
Brady Kelly wrote: where attributes and where elements etc
There is no cookbook approach. The best advice would be to NOT mix "actual data". Meaning don't put some data in text nodes and others in attributes. So if you use text nodes for data then attribute usage should be limited to Metadata usage. Conversely if you are going to have much metadata then using text nodes for the real data might make the XML more readable.
I hope that helps at least a little
led mike
|
|
|
|
|
HELP EACH OTHER TO GROW TOGETHER.
|
|
|
|
|
You should post a question or an issue if you want an answer.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Without access to the source code this is impossible (well legally anyway and depending on the setup illegally as well).
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
I've got some data already formatted in xml format stored in a single excel cell. I want to export the formatted xml data held in this single cell as a full xml document using excel vba.
Does anyone know how to do this?
Al
|
|
|
|
|
|
Thanks George. I'll take a good look at this.
Al
|
|
|
|
|
Hey guys, I was wondering how do I change the settings of a webpage programatically if the page is using an external styles sheet (lets say styles.css).
If I would like to...lets say change the background color in the load event of the page or perhaps the button click event...right now I'm doing that in the html mode by assigning the value directly to the inline style element.
But I'll be creating external style sheets, and would like to grab the values from their programatically in code behind.
Can some one point me to the right direction??
Thanks
~TINA
|
|
|
|
|
i don't really understand u, but you can change "styles" using javascript, another way its you read first the css file, and then apply your external styles.
|
|
|
|
|
If you are talking about toggling between to different style sets, for example, the easiest way I have found is to change the "class" attribute via javascript. Of course, you should have already created these "classes" in an internal or external style sheet(s).
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hello!
Ive got a configfile looking something like this:
name="test"
host="164.9.193.32"
protocol="1.2.3.4" port="89"
application="c:\test\test.exe"
useDefaultCredentials="false"
Im trying to update the config with this:
XmlNode node = null;
XmlNode attrNode = null;
for (int i = 0; i < nodeList.Count; i++)
{
node = nodeList.Item(i);
attrNode = node.Attributes.GetNamedItem("host", "");
attrNode.Value = NewHostValue;
attrNode = node.Attributes.GetNamedItem("port", "");
attrNode.Value = NewPortValue;
attrNode = node.Attributes.GetNamedItem("protocol", "");
attrNode.Value = NewProtocolValue;
attrNode = node.Attributes.GetNamedItem("application", "");
attrNode.Value = NewApplicationValue;
}
But after this is run the data comes out in a single row without newlines.
<assembly name="test" host="164.9.193.32" protocol="1.2.3.4" port="89" application="c:\test\test.exe" useDefaultCredentials="false" />
Im having a hard time coming up with a good way to keep the old look, anyone got an idea?
/regards
-- modified at 9:16 Friday 12th January, 2007
|
|
|
|
|
Disregard that. You might have to use an XSL transform to introduce linebreaks.
led mike
|
|
|
|
|
okay, what would that look like?
|
|
|
|
|
Hi,
Is it possible to generate a working code with a working logic in it from a xml file. If yes then how?? I have to build a class with methods and attributes from XML on some machine. So machine updates the code in run time and then receives objects from various sources and do some algorithm on them??? Any idea??
Regards
Ash
|
|
|
|
|
For my XML parser code
IXMLDOMNode* iNode = NULL;
IXMLDOMNodeList* List = NULL;
iRooterElm->get_childNodes( &List );
long Amount=0;
List->get_length( &Amount );
for( int i = 0; i <=Amount; i++ )
{
List->get_item( i, &iNode );
DisplayChildren( (IXMLDOMElement*)iNode ); // This is where the parsing is done
}
When the child element has no siblings ,the call to DisplayChildren( (IXMLDOMElement*)iNode ); wroks fine and parses the element into tags and text.
But when the child element has siblings ,List->get_length( &Amount ) returns a wrong length and returns amount as 1.ie it doesnt count all siblings ..so my call to DisplayChildren
happens only once and only first child is parsed ..other siblings are simply left out
lkrishn
|
|
|
|
|
I am fairly new to the idea of web services and I was just told by a programmer that they send the pre-formatted XML to the web service URL. I am curious what it is that would require that they send it in that way and how they do that.
Cleako
|
|
|
|
|
Hi guys
question #1
I have a web sites that sells computer parts and accessories, and I design a webservice for my products to distrubute the parts list.
it is under ;
http://cemalpcstore.com/webservice.aspx?wsdl
could you please test and see if it is working, I just learn how to make one I am still studying on consuming xml web services
anyway, please let me know what you think (regarding speed, and if contents are sufficient) no password or username required.
question #2
how should I let my clients know what are fields are that they should be expecting from response object??
thanks
Cemal
ps.as you can see I am newbie to the subject.
|
|
|
|
|
How to parse an XML and display the nested/nonnested nodes in it
|
|
|
|
|
Hello again...
I really appreciate the help you folks are giving me.
I have an XmlElement from a validated XmlDocument. I can't find a way to retrieve the element's expected attributes from its SchemaInfo property.
I was hoping this property would tell me all about how this element is described in the schema (i.e. what child elements are valid on it, what attributes are valid on it, etc.).
Am I barking up the wrong tree? I simply need a list of ALL valid attributes on the element.
BTW, XmlSchemaValidator looked promising, but it always returns null from the GetExpectedAttributes method when the context is the element that was validated. It retrieves the attributes for any of the validated element's CHILD ELEMENTS but can't seem to retrive them for the validated element...
Thoughts?
Thanks so much!
Ian
|
|
|
|
|
Never done this before, but basing on the docs I think the following may work:
XmlSchemaType xmlSchemaType = xmlElement.SchemaInfo.SchemaType;
if (xmlSchemaType is XmlSchemaSimpleType)
{
}
else if (xmlSchemaType is XmlSchemaComplexType)
{
XmlSchemaObjectCollection attributes = ((XmlSchemaComplexType)xmlSchemaType).Attributes;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks for the reply. I actually figured out how to get the information from the XmlSchemaValidator.GetExpectedAttributes method.
|
|
|
|
|
Hi,
Well i'd like the pages in my site to appear differently (such as background color, text size, font etc) based on if the user click on a certain button from the home page. Now the pages are the same as when the user doesn't click on the button (use customized site) and therefore what I'm thinking is to create new style sheets (in addition to the ones that are currently being used by the pages) and then add their references to the aspx pages also (since we could have multiple external style sheets in any particular aspx page). What do you guys think about this approach?? or if there's a better design then this???
Secondly if I go with this approach, how do I make the subsequent pages (after the user has clicked on Customize my site button) use the newly created styles sheets with my new properties?
Any suggestions would be appreciated!
Thanks
~TINA
|
|
|
|
|
Derive all pages from a common base. Set the style sheet file in a variable, which stores it in the session. Make the base class set the CSS file from that property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|