I'm sure there's a very weasy way to do this, I've been running hard and
fast on several things at once and just may be at the point of overthinking
this...
I receive an incoming XML document via a string feed within a web service:
<Root>
<Product>
<File>Order</File>
<Origin>OregonO ffice</Origin>
<Details Name="Product" Value="Binder" />
<Details Name="Qty" Value="1" />
</Product>
</Root>
I need to modify the outgoing XML to read the status of an approval check:
<Root>
<Product>
<File>Order</File>
<Origin>OregonO ffice</Origin>
<Details Name="Product" Value="Binder" />
<Details Name="Qty" Value="1" />
<Details Name="Approved" Value="False" />
</Product>
</Root>
Once I have the True or False value from a method call, how would I modify
the XML to add the new attributes?
TIA
-Rich 10 2652
dim dom as new XmlDocumen
dom.loadxml(you rxmlstring
dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct"
For each product as XmlNode in Product
dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each produc
dim tmpNode as XmlNode = dom.CreateEleme nt("Details"
dim xAtt as XmlAttribute = dom.CreateAttri bute("Name"
xatt.value = "Approved
tmpNode.attribu tes.append(xatt
'repeat above to add more attribute
product.appendc hild tmpnod
Nex
----- Rich Wallace wrote: ----
I'm sure there's a very weasy way to do this, I've been running hard an
fast on several things at once and just may be at the point of overthinkin
this..
I receive an incoming XML document via a string feed within a web service
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root
I need to modify the outgoing XML to read the status of an approval check
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root
Once I have the True or False value from a method call, how would I modif
the XML to add the new attributes
TI
-Ric
dim dom as new XmlDocumen
dom.loadxml(you rxmlstring
dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct"
For each product as XmlNode in Product
dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each produc
dim tmpNode as XmlNode = dom.CreateEleme nt("Details"
dim xAtt as XmlAttribute = dom.CreateAttri bute("Name"
xatt.value = "Approved
tmpNode.attribu tes.append(xatt
'repeat above to add more attribute
product.appendc hild tmpnod
Nex
----- Rich Wallace wrote: ----
I'm sure there's a very weasy way to do this, I've been running hard an
fast on several things at once and just may be at the point of overthinkin
this..
I receive an incoming XML document via a string feed within a web service
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root
I need to modify the outgoing XML to read the status of an approval check
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root
Once I have the True or False value from a method call, how would I modif
the XML to add the new attributes
TI
-Ric
Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an
exact spot?
I.e:
<Root>
<Product>
<File>Order</File>
<Origin>OregonO ffice</Origin>
<Details Name="Product" Value="Binder" />
<Details Name="Qty" Value="1" /> -- I want to make sure I place my new
line after the Qty and before Mfr
<Details Name="Mfr" Value="ABC Co." />
</Product>
</Root>
Thanks again.
-r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message
news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag
here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running hard
and fast on several things at once and just may be at the point of
overthinking this...
I receive an incoming XML document via a string feed within a web
service:
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details
Name="Product" Value="Binder" /><Details Name="Qty" Value="1"
/></Product></Root> I need to modify the outgoing XML to read the status of an approval
check:
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details
Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details
Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an
exact spot?
I.e:
<Root>
<Product>
<File>Order</File>
<Origin>OregonO ffice</Origin>
<Details Name="Product" Value="Binder" />
<Details Name="Qty" Value="1" /> -- I want to make sure I place my new
line after the Qty and before Mfr
<Details Name="Mfr" Value="ABC Co." />
</Product>
</Root>
Thanks again.
-r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message
news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag
here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running hard
and fast on several things at once and just may be at the point of
overthinking this...
I receive an incoming XML document via a string feed within a web
service:
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details
Name="Product" Value="Binder" /><Details Name="Qty" Value="1"
/></Product></Root> I need to modify the outgoing XML to read the status of an approval
check:
<Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details
Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details
Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Can anybody assist? I'm not sure where to look in MSDN or online help, I
can't seem to find what I'm looking for.
"Rich Wallace" <ri**********@m inusthecannedme at.jfsheadotcom > wrote in
message news:OP******** ******@tk2msftn gp13.phx.gbl... Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an exact spot?
I.e: <Root> <Product> <File>Order</File> <Origin>OregonO ffice</Origin> <Details Name="Product" Value="Binder" /> <Details Name="Qty" Value="1" /> -- I want to make sure I place my
new line after the Qty and before Mfr <Details Name="Mfr" Value="ABC Co." /> </Product> </Root>
Thanks again. -r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running
hard and fast on several things at once and just may be at the point of overthinking this...
I receive an incoming XML document via a string feed within a web service: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root> I need to modify the outgoing XML to read the status of an approval
check: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Can anybody assist? I'm not sure where to look in MSDN or online help, I
can't seem to find what I'm looking for.
"Rich Wallace" <ri**********@m inusthecannedme at.jfsheadotcom > wrote in
message news:OP******** ******@tk2msftn gp13.phx.gbl... Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an exact spot?
I.e: <Root> <Product> <File>Order</File> <Origin>OregonO ffice</Origin> <Details Name="Product" Value="Binder" /> <Details Name="Qty" Value="1" /> -- I want to make sure I place my
new line after the Qty and before Mfr <Details Name="Mfr" Value="ABC Co." /> </Product> </Root>
Thanks again. -r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running
hard and fast on several things at once and just may be at the point of overthinking this...
I receive an incoming XML document via a string feed within a web service: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root> I need to modify the outgoing XML to read the status of an approval
check: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Rich:
in xml, the order of the child nodes (or attributes of a node) does not really matter. (atleast it shouldn't)
you can use the prependchild() method to append a child as a first child to a node.
google for more samples if you absolutely have to have the node at a particular position.
"Rich Wallace" wrote: Can anybody assist? I'm not sure where to look in MSDN or online help, I can't seem to find what I'm looking for.
"Rich Wallace" <ri**********@m inusthecannedme at.jfsheadotcom > wrote in message news:OP******** ******@tk2msftn gp13.phx.gbl... Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an exact spot?
I.e: <Root> <Product> <File>Order</File> <Origin>OregonO ffice</Origin> <Details Name="Product" Value="Binder" /> <Details Name="Qty" Value="1" /> -- I want to make sure I place my new line after the Qty and before Mfr <Details Name="Mfr" Value="ABC Co." /> </Product> </Root>
Thanks again. -r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running hard and fast on several things at once and just may be at the point of overthinking this...
I receive an incoming XML document via a string feed within a web service: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root> I need to modify the outgoing XML to read the status of an approval
check: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Rich:
in xml, the order of the child nodes (or attributes of a node) does not really matter. (atleast it shouldn't)
you can use the prependchild() method to append a child as a first child to a node.
google for more samples if you absolutely have to have the node at a particular position.
"Rich Wallace" wrote: Can anybody assist? I'm not sure where to look in MSDN or online help, I can't seem to find what I'm looking for.
"Rich Wallace" <ri**********@m inusthecannedme at.jfsheadotcom > wrote in message news:OP******** ******@tk2msftn gp13.phx.gbl... Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it in an exact spot?
I.e: <Root> <Product> <File>Order</File> <Origin>OregonO ffice</Origin> <Details Name="Product" Value="Binder" /> <Details Name="Qty" Value="1" /> -- I want to make sure I place my new line after the Qty and before Mfr <Details Name="Mfr" Value="ABC Co." /> </Product> </Root>
Thanks again. -r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message news:9D******** *************** ***********@mic rosoft.com... dim dom as new XmlDocument dom.loadxml(you rxmlstring) dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct")
For each product as XmlNode in Products dim bApproved as Boolean = GetApprovalValu e() 'get your boolean flag here. for each product dim tmpNode as XmlNode = dom.CreateEleme nt("Details") dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") xatt.value = "Approved" tmpNode.attribu tes.append(xatt )
'repeat above to add more attributes
product.appendc hild tmpnode
Next ----- Rich Wallace wrote: -----
I'm sure there's a very weasy way to do this, I've been running hard and fast on several things at once and just may be at the point of overthinking this...
I receive an incoming XML document via a string feed within a web service: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root> I need to modify the outgoing XML to read the status of an approval
check: <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /><Details Name="Approved" Value="False" /></Product></Root> Once I have the True or False value from a method call, how would I
modify the XML to add the new attributes?
TIA -Rich
Thanks for the info.
"tMan" <tM**@discussio ns.microsoft.co m> wrote in message
news:61******** *************** ***********@mic rosoft.com... Rich: in xml, the order of the child nodes (or attributes of a node) does not
really matter. (atleast it shouldn't) you can use the prependchild() method to append a child as a first child
to a node. google for more samples if you absolutely have to have the node at a
particular position. "Rich Wallace" wrote:
Can anybody assist? I'm not sure where to look in MSDN or online help,
I can't seem to find what I'm looking for.
"Rich Wallace" <ri**********@m inusthecannedme at.jfsheadotcom > wrote in message news:OP******** ******@tk2msftn gp13.phx.gbl... Works, thank you.
Is there a way to nivagiate through the doc and make sure I place it
in an exact spot?
I.e: <Root> <Product> <File>Order</File> <Origin>OregonO ffice</Origin> <Details Name="Product" Value="Binder" /> <Details Name="Qty" Value="1" /> -- I want to make sure I place
my new line after the Qty and before Mfr <Details Name="Mfr" Value="ABC Co." /> </Product> </Root>
Thanks again. -r
"tMan" <an*******@disc ussions.microso ft.com> wrote in message news:9D******** *************** ***********@mic rosoft.com... > dim dom as new XmlDocument > dom.loadxml(you rxmlstring) > dim products as XmlNodeList = dom.selectnodes ("descendant::p roduct") > > For each product as XmlNode in Products > dim bApproved as Boolean = GetApprovalValu e() 'get your boolean
flag here. for each product > dim tmpNode as XmlNode = dom.CreateEleme nt("Details") > dim xAtt as XmlAttribute = dom.CreateAttri bute("Name") > xatt.value = "Approved" > tmpNode.attribu tes.append(xatt ) > > 'repeat above to add more attributes > > product.appendc hild tmpnode > > Next > > > > ----- Rich Wallace wrote: ----- > > I'm sure there's a very weasy way to do this, I've been running hard and > fast on several things at once and just may be at the point of overthinking > this... > > I receive an incoming XML document via a string feed within a
web service: > > <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1" /></Product></Root> > > I need to modify the outgoing XML to read the status of an
approval check: > > <Root><Product> <File>Order</File><Origin>Or egonOffice</Origin><Details Name="Product" Value="Binder" /><Details Name="Qty" Value="1"
/><Details Name="Approved" Value="False" /></Product></Root> > > Once I have the True or False value from a method call, how
would I modify > the XML to add the new attributes? > > TIA > -Rich > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: waters |
last post by:
I seem to have hit a snag.
I am trying to add the list (l_local) as an item in the output list
(l_output). "l_local" is a modified copy of the format-list "l_format",
which will be updated by index position within the function. The problem
occurs in the following statement block:
def create_apid_list(l_format,l_values):
l_output =
for t_curr_line in l_values: # ...for each list in the values list
|
by: sm |
last post by:
How to "Insert" (not append) new text segment to an existing text file?
Assume that we have text file as shown below;
Elvis
Sofia
Kylix
BCB--> How to insert here?
Atten
BuilderX
Roma
|
by: Jonathan Buckland |
last post by:
Can someone give me an example how to append data without having to
load the complete XML file.
Is this possible?
Jonathan
|
by: Sven Pran |
last post by:
Probably the answer is there just in front of me only awaiting me to
discover it,
but:
1: I want to build a query that returns all records in one table for which
there is no successful "join" in another table but I have not found what the
field
criteria should look like?
2: And if/when I succeed I should further like to build a new record (with
|
by: What-a-Tool |
last post by:
Remember seeing a post a while back from someone who wanted to add to a
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't
remember - could someone refresh my memory on this please?
Thanks
| |
by: Matrix |
last post by:
I want to append records in a XML file,I use XMLTextWriter,but i found it
only create a XML file,not append records in exist XML file.why?
-------------------------------------------------
XmlTextWriter myXmlTextWrite = new XmlTextWriter(@"C:\myconfig.xml");
myXmlTextWrite.WriteStartDocument();
myXmlTextWrite.WriteStartElement("Record");
myXmlTextWrite.WriteStartElement("Topic");
myXmlTextWrite.WriteString(XMLTopic);...
|
by: MN |
last post by:
I have to import a tab-delimited text file daily into Access through a
macro. All of the data needs to be added to an existing table. Some of
the data already exists but may be updated by the imported text file. I
can update the data through an update query or append the entire import
table through an append query. Is there a way to combine the two so that
I can update existing records and append only new records (without
duplicating...
|
by: mpslanker |
last post by:
This is my first time posting here, so if I have made any mistakes (i.e. wrong forum area, etc) I am sorry.
I have an Access database that I have to import a text file into and append it to a certain table. I know this part of my question has been answered and I understand how to do it quite well after searching long and hard for an answer to my next part. I can either import the text file directly into the table or into it's own seperate...
|
by: vj |
last post by:
I am using Borland C++.
I run a program which generates output data files, say 'Voltage.dat',
'Current.dat'. I have a variable in my code (say N), and for various
values of N (for each value of N), I generate these output data files.
After running the program once for a given value of N (say N equal to
1) and when the programme is finished, I manually append the generated
filename with the value of N, such as 'Voltage_N1.dat',...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |