changing an emelent into an attribute

i have a file like this (which im manipulating using 
vb.net)

<CUSTOMERS>
	<PRIMARY>Y</PRIMARY>
	<SURNAME>BROWN</SURNAME>

which i want to make like this

<CUSTOMERS PRIMARY="Y">
	<SURNAME>BROWN</SURNAME>

i dont know whether to this is easy to do using xsl or 
whether this is a better way using DOM and Xpath or 
something.  Any help is greatly appreciated. thanks.
0
anonymous (74722)
11/19/2003 1:37:11 AM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
465 Views

Similar Articles

[PageSpeed] 33

XSL and DOM both work. Go with whatever you ( or your team ) feels more
comfortable maintaining going forward.

It;s hard to give a good recommendation on a tiny example. There are many
more factors to consider ..

-- 
HTH
Christoph Schittko [MVP, XmlInsider]
Software Architect, .NET Mentor

"Raife" <anonymous@discussions.microsoft.com> wrote in message
news:04c101c3ae3d$a71c6580$a501280a@phx.gbl...
> i have a file like this (which im manipulating using
> vb.net)
>
> <CUSTOMERS>
> <PRIMARY>Y</PRIMARY>
> <SURNAME>BROWN</SURNAME>
>
> which i want to make like this
>
> <CUSTOMERS PRIMARY="Y">
> <SURNAME>BROWN</SURNAME>
>
> i dont know whether to this is easy to do using xsl or
> whether this is a better way using DOM and Xpath or
> something.  Any help is greatly appreciated. thanks.


0
11/19/2003 4:26:53 AM
thanks but im having trouble doing it either way!
>-----Original Message-----
>XSL and DOM both work. Go with whatever you ( or your 
team ) feels more
>comfortable maintaining going forward.
>
>It;s hard to give a good recommendation on a tiny 
example. There are many
>more factors to consider ..
>
>-- 
>HTH
>Christoph Schittko [MVP, XmlInsider]
>Software Architect, .NET Mentor
>
>"Raife" <anonymous@discussions.microsoft.com> wrote in 
message
>news:04c101c3ae3d$a71c6580$a501280a@phx.gbl...
>> i have a file like this (which im manipulating using
>> vb.net)
>>
>> <CUSTOMERS>
>> <PRIMARY>Y</PRIMARY>
>> <SURNAME>BROWN</SURNAME>
>>
>> which i want to make like this
>>
>> <CUSTOMERS PRIMARY="Y">
>> <SURNAME>BROWN</SURNAME>
>>
>> i dont know whether to this is easy to do using xsl or
>> whether this is a better way using DOM and Xpath or
>> something.  Any help is greatly appreciated. thanks.
>
>
>.
>
0
anonymous (74722)
11/19/2003 5:24:36 AM
can you be more specific? What are you trying to do? Is it something that's
specific to one document format do you need a more generic solution? How big
are the documents that you are processing?

-- 
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

<anonymous@discussions.microsoft.com> wrote in message
news:062701c3ae5d$6bed4810$a101280a@phx.gbl...
> thanks but im having trouble doing it either way!
> >-----Original Message-----
> >XSL and DOM both work. Go with whatever you ( or your
> team ) feels more
> >comfortable maintaining going forward.
> >
> >It;s hard to give a good recommendation on a tiny
> example. There are many
> >more factors to consider ..
> >
> >-- 
> >HTH
> >Christoph Schittko [MVP, XmlInsider]
> >Software Architect, .NET Mentor
> >
> >"Raife" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:04c101c3ae3d$a71c6580$a501280a@phx.gbl...
> >> i have a file like this (which im manipulating using
> >> vb.net)
> >>
> >> <CUSTOMERS>
> >> <PRIMARY>Y</PRIMARY>
> >> <SURNAME>BROWN</SURNAME>
> >>
> >> which i want to make like this
> >>
> >> <CUSTOMERS PRIMARY="Y">
> >> <SURNAME>BROWN</SURNAME>
> >>
> >> i dont know whether to this is easy to do using xsl or
> >> whether this is a better way using DOM and Xpath or
> >> something.  Any help is greatly appreciated. thanks.
> >
> >
> >.
> >


0
11/20/2003 3:55:21 AM
Reply:

Similar Artilces:

tabs on change
I have Reservationfrm with tabCtrlReservations. Reservationfrm has a subform Jobfrm with with tabControlInvoice. I want to prevent movement away from tabControlInvoice should the user click on a tab of tabCtrlReservations when conditions are met. Can/will someone show me the way? Thanks in advance. In the tab control's On Change event (not the tab page itself but the overall control), put something like: If WhateverCondition = Whatever Then tabControlInvoice.SetFocus End If Since I don't know your exact conditions or control names I can't give you exact specifics, but...

Can't change recordsource in Form_Open in Access 2007
Hi, I have an Access 2003 front-end that I am testing in Access 2007. In Access 2003, I was able to set Me.Recordsource in the Form_Open event, which would immediately trigger Form_Current. In 2007, I can't seem to set the recordsource in the same way. The recordsource is empty just before the line: Me.Recordsource = "Select * from tblObject" When I check the value of Me.Recordsource in the immediate window immediately after executing this line, it is still empty. I verified that tblObject is a valid linked SQL Server table. I also tried setting it to a local Access table...

Changing size of parameter fields?
Hi, Using reporting services from SQL 2005 Server. I have a report that uses a multi-value parameter that pulls data from a data set and when I run the report it displays it in a nice little dropdown box. Problem is that some of the names in the dropdown list are longer than the list displays. Is it possible to change the dimensions on the dropdown list itself? I'd just like to make it wider, any ideas how I can do that? Thanks in advance, Linn ...

Change catagories
I have searched this site, and can't believe I can't find the answers. So, I apologize if this has already been covered. I am using the trial version of Money 2006. Previously, I had 2005. My catagories are all screwed up. But worse than that, it will not allow me to fix it. Best example is the catagory for Food. I want Dining Out and groceries to be all under Food. Money thinks these should all be seperate. When I get it to allow Dining Out to be a sub under Food, it wants to keep the catagory group as groceries (which it's not, it's food). I don't know how...

when I open excel file,changes was undid-excel 2007, compatibility
I have a file that was made in excel 2007 working in compatibility mode and when I change format in some cell (for example font size), then I save changes and after reopen this fiel the changes was undid. Can some help me? Sorry for my english isn't very well -- thanks Pedro ...

Unable to change "Enabled" state of an Excel 2007 ribbon gallery b
Hi folks, Looking for help on this. If we embed a button inside an excel 2007 ribbon gallery, it is not possible to change its "Enabled" state after a workbook is opened and the gallery is expanded. Only on workbook open the "getEnabled" callback is successfully executed and the proper state is achieved. Following workbook open as well, before the gallery is expanded, the state changes successfully. However once the gallery is expanded the state cannot be changed. Buttons that are not embedded in a gallery work just fine. can be definitely seen on SP0 and S...

change the defualt settings for comment boxes
how do you change the default settings for the comment boxes in excel See http://www.mvps.org/dmcritchie/excel/ccomment.htm and several pages at Debra's pages http://www.contextures.com/tiptech.html -- --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Rick" <Rick@discussions.microsoft.com> wrote in message news:4524F2E5-3C40-41AF-A669-233A8336CDF1@microsoft.com... > how do you change the default settin...

If sign of sum is negative change to positive
I am using a formula that may produce positive or negative results. Once it has produced the sum the sign is immaterial. I need the result to add as a positive. I need something that says if the sum is less than 0 change the result to positive. How do I do that? Hi, =ABS(yoursum) Mike "BigR" wrote: > I am using a formula that may produce positive or negative results. Once it > has produced the sum the sign is immaterial. I need the result to add as a > positive. > I need something that says if the sum is less than 0 change the result to >...

Dragging a Cell Changes Formula
I am creating a spreadsheet which will be protected with a table of cells unlocked for the user to fill in. There are formulas which reference the unlocked cells. Is there anyway to prevent these formulas from changing if the user drags (or cut-and-pastes) the unlocked cell (ie, if they type data in the wrong cell and then drag that data to the correct cell, any formula reference these two cells gets modified)? Thanks! --- Message posted from http://www.ExcelForum.com/ Janet, Make the formulas "absolute" =A1 will adjust when it's moved or dragged anywhere. =$A1 will "...

Changing Data format
I would be willing to do this either in Excel or Access, I am not sure of the preferred method I have data that starts out as below: MAIN NUM COMMON NUM A 0001 B 0001 C 0001 D 0001 A 0003 B 0003 A 0005 B 0005 C 0005 I need to change the way the data appears on the spreadsheet to the following: MAIN NUM COMMON NUM NUM 1 NUM 2 NUM 3 NUM 4 A 0001 A B C D B 0001 ...

Changing chart color based on number entered
I am trying to creat a simple pie chart with two numbers. I need the chart colors to reflect the number. Example: 0-50 = red; 50-100 = blue. If one week the first number is 37, the left side of the chart would be red. The next week the number could be 89, so the left side would need to be blue. Any ideas? ...

Changing options in the registry
I have been searching for some settings i need to change for all my users in registry, i need to make change, export the key and then add the import key into logon scripts....is there a tool for finding keys as i have searched on every word and it comes up with nothing RegShot is one of the utilities that can do it. What option are you looking for? In case you are running Active Directory you might be better of setting Policies -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Backup and Restore -Create an Office XP CD slipstreamed with Service Pack 3 ---...

updating lead attributes from the phone call form?
Hi all, Bit of a newbie question here... :-) Is it possible to update Lead attributes from the Phone Call form? And what's the best way to do this? The scenario we're facing is that the first follow-up call is to confirm contact details and level of interest. It'd be cool to be able to do this from within the Phone Call form, instead of having to switch back to the Lead form. Thanks in advance! Mike Hi Mike, Yes it can be done. Best option is to use post callouts. In your case, once user will save phone call activity, callout will update the lead linked with phone call. Det...

Table structure for Course Attributes
I have a database which stores information about courses. This Course table structure is very simple: CourseID, Description, Title, etc. I need to store other information about the courses, but this information is more irregular. I was thinking about creating a CourseAttribute table with just a few fields: CourseID, AttributeType, AttributeValue, SortOrder. If I need to store books needed, it would be in Attribute records: CourseID, AttributeType = "Book", AttributeValue= bookID. A course may have several books, or no books. If I need to store lists of Course Obj...

Macro to change validation list and print
Hi, I have a worksheet with graphs and tables on it which are all based on a validation list (the drop down menu variety) with about a dozen categories. Obviously when i change the selected category, all the graphs and tables change too. I would like to create a macro that will print one copy of the worksheet for each category on the validation list, rather than having to manually change the list and then print the worksheet a dozen times. Any suggestions? Andy Did you put that list of 12 on a worksheet or did you enter it in the data|validation dialog directly? If you put it in a...

Changing Calendar Permissions
Hi, we have a user on vacation and I need to give another user permission to add calendar entries. Is there a way as admin for me to do this without brining up ADUC and changing their password, logging into their destkop and making that change? Mike ...

Is it supported to change database collation
To change collaction of a database (2005) you have to ALTER DATABASE, with which you can change the default collation. And ALTER TABLE with which you can change collation, column by column. The last one requires that you drop indexes etc first. I need to change collaction due to make sort order work for swedish characters. Is this supported or do i have to make a fresh install with correct default collation and then make a custom program to export/import all data. // Mats Hi, Making database modifications, and therefore changing the collation, is unsupported. You need this because so...

Change dates to non-numeric text
Is there an effective way to convert dates to non- numeric 'general text', so that a date formated as 'MMM' will appear in text as Feb (for example), while a date formatted as 'YYYY' will appear as 2004 (another example). I am working with a pivot table - but am getting multiple same year entries in a layout pull-down menu? Ecen though I have formatted the dates as MMM and YYYY respectively I note that if I click on the cell the dates still appear in the conventional DD/MMM/YYYY format? I think this is causing my problem ... Don- Hi Don try =TEXT(A1,"MMMM...

Customizing Activities / History List saving changes
Hi I have made some changes to CRM forms using formeditor. I do not know how will these changes show in my system. I have uploaded customization but its not working. Any suggestions, advice please Sarah did you publish the changes via Deployment Manager on the CRM server? -Gary "Sarah" <anonymous@discussions.microsoft.com> wrote in message news:62416116-EB6B-4CF8-AE4A-BBB4628F1923@microsoft.com... > Hi > I have made some changes to CRM forms using formeditor. I do not know how will these changes show in my system. I have uploaded customization but its not working. >...

Change state of detached column of dataGridView.
In VB.NET 2008 (VS 2008) I see I can change the state of an unChanged column, but for detached column - I cannot change the state. Dim objRowV As DataRowView Dim objRow As DataRow objRowV = myBindSource.Current objRow = objRowV.Row objRow("my_column") = 123 objRow.SetAdded() ' **** this line troughs an exception. **** .... How can I handle this case ? Thanks :) Am 10.04.2010 15:00, schrieb Mr. X.: > In VB.NET 2008 (VS 2008) I see I can change the state of an unChanged > column, > but for detach...

change a zero's to null in a table ?
Hello all, without using a search and replace utility , is there a method to remove or change any field that contains a '0' to null ? TIA David Do you want to change the value to null if the value is zero? Or do you want to change the value to null if the value has a zero anywhere in it? I am guessing the former. You should be able to use the following expression if you just want to do this temporarily IIF([SomeField] = 0, Null, SomeField) If you want to do it permanently, you would probably use an update query. UPDATE SomeTable Set SomeField = Null WHERE SomeField = 0 ...

Did the newsgroup search programming change?
Hi, After I post something to this newsgroup, I used to go back a day or two later and search by "PTweety" or "pickytweety" to find my post and check the answers received. Now when I search that way, I see several of my 2008 and 2009 posts, but not my recent posts (like 1-20-2010). How come? Did the search programming change? I know it's more likely that I'm doing something different, but I can't figure out what! -- Thanks, PTweety On Jan 25, 12:46=A0pm, pickytweety <pickytwe...@discussions.microsoft.com> wrote: > Hi, > After ...

change sales id
Anyone know of a 3rd Party product that will change a salesman ID? or maybe a SQL script that will do it? we have a salesman id set up incorrectly and it was not caught until a month's worth of sales were posted to it and we do not want to lose that information or have it divided between 2 ids. TIA, -- ============================== ryanb. xl 2002, access 2002, greatplains 7.5 ============================== If you do not find a tool try running this script in SQl Query Analyzer select * from sysobjects o, syscolumns c where o.id = c.id and o.type = 'U' and c....

Changing Header Information
I would like to hide the header information that Exchagne provides to something more secure. I would prefer that the version of exchange and the SMTP version not be displayed. Can this be changed without violating the RCF rules regarding necessary header information? Thank you in advance, Adrian Diett On Mon, 2 Jan 2006 15:33:31 -0500, "Overseer" <overseer@cogeco.ca> wrote: >I would like to hide the header information that Exchagne provides to >something more secure. I would prefer that the version of exchange and the >SMTP version not be displayed. Can...

How do I change a field size?
I have a number of tables which have a text field of the same name. It is used to hold a record reference number and links the tables together in queries. Currently it is 15 characters long but I want to increase it to 20. If I try and do it in table design I get a message that says it is used to link tables in a relationship and I must delete the relationship first. Is there anyway I can do this rather than opening dozens of queries, deleting the relationship, change the field size then open all the queries again to re-create the relationship? I tried opening the Relationship window bu...