|
pls how can i create xml root node in this format using vb.net dom
<digital_report xmlns:xsi="http://me.org/xmlschemainstance" xsi:="" nonamespaceschemalocation="sdp_schema_010.xsd">
|
|
|
|
|
|
The html monster has been cut loose again...
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
i have this cde
dim doc as New XmlDocument
Dim declarationNode As XmlNode = doc.CreateXmlDeclaration("1.0", "", "")
doc.AppendChild(declarationNode)
Dim reportNode As XmlNode = doc.CreateElement("REPORT")
Dim att As XmlAttribute = doc.CreateAttribute("xmlns:xsi")
att.Value = "http://www.w3.org/2001/XMLSchema-instance"
reportNode.Attributes.Append(att)
Dim att1 As XmlAttribute = doc.CreateAttribute("xsi:noNamespaceSchemaLocation")
att1.Value = "SCHEMA_010.xsd"
reportNode.Attributes.Append(att1)
i recieved
<report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" nonamespaceschemalocation="SCHEMA_010.xsd">;
instead of
<report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="SCHEMA_010.xsd">;
why is it trncating
xsi:noNamespaceSchemaLocation to noNamespaceSchemaLocation
|
|
|
|
|
Your second attribute declaration is wrong.
Ebube wrote: Dim att1 As XmlAttribute = doc.CreateAttribute("xsi:noNamespaceSchemaLocation")
att1.Value = "SCHEMA_010.xsd"
reportNode.Attributes.Append(att1)
You should have :
Dim att1 As XmlAttribute = doc.CreateAttribute("xsi:noNamespaceSchemaLocation", "http://www.w3.org/2001/XMLSchema-instance")
att1.Value = "SCHEMA_010.xsd"
reportNode.Attributes.Append(att1)
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
i try it and get
PENCOM_REPORT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" d1p1:noNamespaceSchemaLocation="PFC_SCHEMA_010.xsd">
xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance"
if i comment out att
i get
<PENCOM_REPORT xsi:noNamespaceSchemaLocation="PFC_SCHEMA_010.xsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
but want i need is
<PENCOM_REPORT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PFC_SCHEMA_010.xsd">;
|
|
|
|
|
You must have a typo somewhere.
Here is the full code snippet, as based on your code. It works and generates the output you require.
Dim doc As New System.Xml.XmlDocument()
Dim declarationNode As System.Xml.XmlNode = doc.CreateXmlDeclaration("1.0", "", "")
doc.AppendChild(declarationNode)
Dim reportNode As System.Xml.XmlNode = doc.CreateElement("PENCOM_REPORT")
Dim att As System.Xml.XmlAttribute = doc.CreateAttribute("xmlns:xsi")
att.Value = "http://www.w3.org/2001/XMLSchema-instance"
reportNode.Attributes.Append(att)
Dim att1 As System.Xml.XmlAttribute = doc.CreateAttribute("xsi:noNamespaceSchemaLocation", "http://www.w3.org/2001/XMLSchema-instance")
att1.Value = "SCHEMA_010.xsd"
reportNode.Attributes.Append(att1)
doc.AppendChild(reportNode)
Dim XMLOutput As String = doc.OuterXml
Resulting string XMLOutput is
<?xml version="1.0"?><PENCOM_REPORT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SCHEMA_010.xsd" />
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
i cannot get same result still repeat <PENCOM_REPORT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" d1p1:noNamespaceSchemaLocation="PFC_SCHEMA_010.xsd">;
xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
Please post the exact code you are running. I can then assist you further.
The code snippet I posted does not have "d1p1" in it anywhere, so clearly you are running some different code.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
it worked. is a typo. Thanks
|
|
|
|
|
Hello ,
I am designing a VB application where i am forcing a machine shutdown using function as below.
Function InitiateSystemShutdown Lib "advapi32.dll"
But i found that the user can stop the forced shut down using the command "shutdown –a". So wanted a help as to how I can overcome this command and still force the shutdown.
Thanks in advance for the same.
Here in InitiateSystemShutdown function i am passing the forced parameter as true. still a user with admin rights on the m/c is able to abort the shut down.
|
|
|
|
|
Hi,
Following link might be useful.
http://www.dreamincode.net/code/snippet90.htm[^]
Personally I think its not a good idea to force shutdown on user for whatsoever reason.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Thanks Mithun, but i wanted to know if the forced shut down has been initiated, the user should not be able to stop this by using "shutdown –a" command.
How to achieve this?
|
|
|
|
|
RK,
The link tells you about a function "ExitWindowsEx" Lib "User32" , If you set parameter to FORCE, I think it can not be stopped using shutdown -a. ( I have tried it once and failed as system gets shutdown quickly )
Also I have tried by creating a batch file as following:
shutdown -f
shutdown -a
Still my system logged off.
So i think ExitWindwsEx with FORCED parameter is function for you.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
I am using the InitiateSystemShutdown function and am forcing the shut down still a person with admin rights on the m/c is able to abort the shut down using shutdown -a command.
so any help here.
|
|
|
|
|
Try setting the timeout parameter to 0.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
No , we have to dispaly the message to user some 5 mins before so that he can save the changes, so we can not put the timeout parameter as 0.
|
|
|
|
|
In that case, you have a few options, none of them in code.
Remove the admin rights from the user
Remove the shutdown.exe from the machine
Add shutdown.exe to the list of forbidden executables using group policy
|
|
|
|
|
Hi Dave, Thanks for your reply but we can not implement the above suggestions as the some user need the admin rights on their m/c and also the exe file has to run on each individuals m/c so that it can shut their PC at a particular time. Any other suggestion then pls do let me know.
|
|
|
|
|
Stupid suggestion but how about when you run your shutdown function rename shutdown.exe to shutdown.exe.bak or something so they can't run shutdown.exe with any parameters..
|
|
|
|
|
Than you just ruled out every option you have to preventing the users from aborting the shutdown.
You're only other option how is to threaten people with termination for violating company policy.
|
|
|
|
|
Then I think you have to write your own daemon so that you can connect to it, n call a routine which will show a shutdown timer , and on time up call a forced shutdown with 0 time inerval.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
True. A little extreme for the problem at hand, but then again, they did themselves in with the poorly designed environment and policies.
BTW: You may want to reply to the OP and not me. He's has no idea you posted this message because he didn't get the email that you posted to mine.
|
|
|
|
|
Thanks Dave,
I am new to cp and was unaware of this cool feature.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Hi,
I am developing an application using vs 2008 and vb.net.
There are 4 projects in my solution which uses a same DLL created in vb6.
Now when I compile the solution each time my reference to dll gets lost in each project. ( I have added separate reference to each project). How can I overcome this problem? Is there any better way of adding reference in my case?
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
modified on Tuesday, June 16, 2009 1:57 AM
|
|
|
|