|
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
|
|
|
|
|
Hi all,
Hoping someone can point me in the right direction here. I'm writing a VB.Net 2.0 WinForms admin app to allow users to do maintenance on an Oracle database behind another very large app.
To keep the size of the admin app down and to avoid a maintenance nightmare when the tables (about 70 of them) change I am trying to write it so it's totally automated. I already have code to read the schema of each table to get the columns and then I have a form that adds an appropriate custom control for each type of table column. This works very well but I need it to be advanced enough to hide some columns, make sure others are entered, validate some others, etc, etc.
So my idea is to have an XML file (see below) containing the tables and columns which can be maintained and when the app starts it would read the file and load the data into .Net classes which correspond to the XML (see class definitions below). I can then use these table and column classes to apply custom behaviour to the custom edit form I already have.
So, looking at the XML and class definitions (both kept VERY simple for illustration purposes) can anyone tell me how best to go about this? How could I best read the XML file in and convert it to the classes I've defined?
TIA for any help... I know how to write using lots of fairly manual code but am hoping there is a smarter & quicker way to to do this.
Mike.
<SAMTABLES >
<SAMTABLE >
<TABLE TableName="EMPLOYEE" CustomForm="N" />
<COLUMN ColumnName="ID" ColumnType="int" Required="N" Visible="N"/>
<COLUMN ColumnName="SURNAME" ColumnType="string" Required="Y" Visible="Y" Label="Surname"/>
<COLUMN ColumnName="FIRST_NAME" ColumnType="string" Required="Y" Visible="Y" Label="First Name"/>
<COLUMN ColumnName="EMPLOYEE_NUMBER" ColumnType="int" Required="Y" Visible="Y" Label="Employee No."/>
</SAMTABLE>
<SAMTABLE>
<TABLE TableName="ORDERS" CustomForm="Y" />
<COLUMN ColumnName="ID" Required="N" Visible="N"/>
<COLUMN ColumnName="ORDER_DATE" ColumnType="date" Required="Y" Visible="Y" Label="Order Date"/>
<COLUMN ColumnName="ORDER_ITEMS" ColumnType="int" Required="Y" Visible="Y" Label="Items"/>
<COLUMN ColumnName="ORDER_TOTAL" ColumnType="decimal" Required="Y" Visible="Y" Label="Total"/>
</SAMTABLE>
</SAMTABLES>
Public Class SAMTables
Public Tables() as SAMTAble
End Class
Public Class SAMTable
Public TableName as String
Public CustomForm as String
Public Columns() as SAMColumn
End Class
Public Class SAMColumn
Public ColumnName as String
Public ColumnType as String
Public Required as String
Public Visible as String
Public Label as String
End Class
-- modified at 22:01 Sunday 7th January, 2007
|
|
|
|
|
Sounds like the XmlSerializer is what you're looking for.
"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 - what I did in the end was read the file into an XMLDataDocument object instead of a class structure as it means I can use XPath/XQuery and also have the power of the DatatSet object as well. Once I created the schema file (by loading the XML file into VS2005 and choosing Create Schema from the XML menu) the code was simply as follows:
Public Sub LoadXMLConfig()<br />
<br />
'Read the XML configuration file<br />
dataDoc = New XmlDataDocument()<br />
dataDoc.DataSet.ReadXml(My.Settings.XMLConfigFile)<br />
<br />
End Sub
Just thought I'd post this in case anyone else is wanting to do this sort of thing and comes across this thread.
Mike
|
|
|
|
|
In Word2007 the document is saved as *.docx, which unzips to reveal a group of XML files, including fontTable.xml. If the fonts were embedded that table will include a fontkey for each embedded font, something like:
4FC99FC9-34EB-48D7-B509-17C906D3B8E1
When the docx file is unzipped it includes also a font-like file for each embedded font, with an extension .odttf . This differs from the usual ttf file only in the first 32 bytes, and it is obvious that the application of the key to these 32 bytes will transform it so as to give a valid ttf font file. For that it is necessary to read the key in reverse direction, E1B8 D306... Some times it is only a matter of getting the difference between these words and the corresponding words in the odttf file. However I cannot see the full solution.
Does anyone know how ? I don't see why MS would want to conceal it.
Raymond Mercier
|
|
|
|
|
Hi all.
In my application I am downloading an XML file from the server.
But I don’t want the user to be able to read its contents.
So my question is….
How can I encrypt an XML file and decrypt it while reading its contents through code?
OR
Can I hide some of the tags from an XML file so that user will not see those when he opens that XML?
Thanks
Rakesh Thakur
|
|
|
|
|
Rakesh_Thakur wrote: Can I hide some of the tags from an XML file so that user will not see those when he opens that XML?
No
Rakesh_Thakur wrote: I am downloading an XML file from the server.
What server? Web Server? If Web Server the most common way is to use SSL. Otherwise look at the Crypto API.
led mike
|
|
|
|
|
Hi All,
I use VC.NET and could anyone suggest me how to auto upgrade the XML files at the time of software upgradation..
Thanks..
|
|
|
|
|
Make an Installer Project
led mike
|
|
|
|
|
I was asking how can we develop it and not by Installer Project! Whether it is using XSLT or C#.Which is the preferred and a better way to develop?
|
|
|
|
|
zxc89 wrote: I was asking how can we develop it and not by Installer Project!
zxc89 wrote: software upgradation
I am not familiar with the word "upgradation". If you don't want an installer for updating the components of the application, what do you want?
led mike
|
|
|
|
|
whenever a software is upgraded to another version, the xml files should also be upgraded to that version.
So what i meant was that all the xml files should be upgraded to another version with any changes to its attributes or element values at the time of s/w upgradation.
|
|
|
|