|
how can get the value from a database by using XPath or XQuery
What is XSDL
-
|
|
|
|
|
Based on your array of questions in multiple forums it sure seems like you are needing help on your homework.
|
|
|
|
|
When the xml file is large, it takes sometime to load the file and display it into the browser.
During this time, your browser seems to be stand still. If other people dont know, they might think that there is some problem with your web site and then leave.
Can I display a message like "Loading...", to the browser while waiting for xml file to be loaded?
|
|
|
|
|
I would use javascript to handle this task and is accpeted by all browsers
something like the below is easy to implement
============================================================
INSTRUCTIONS.
This is a MUTI-PART Script.
============================================================
PART I.
Copy code below into <HEAD> section of your HTML pages
============================================================
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
<!-- PreLoad Wait - Script -->
<!-- This script and more from http://www.rainbow.arch.scriptmania.com
function waitPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.visibility='hidden';
}else{
if (document.layers){ //NS4
document.prepage.visibility = 'hidden';
}
else { //IE4
document.all.prepage.style.visibility = 'hidden';
}
}
}
// End -->
</SCRIPT>
============================================================
PART II.
Add the onLoad event, as shown below, to your <BODY> tag:
============================================================
<BODY onLoad="waitPreloadPage();">
============================================================
PART III.
Copy codes below to immediately after <BODY> tag.
============================================================
<DIV id="prepage" style="position:absolute; font-family:arial; font-size:16; left:0px; top:0px; background-color:white; layer-background-color:white; height:100%; width:100%;">
<TABLE width=100%><TR><TD><B>Loading ... ... Please wait!</B></TD></TR></TABLE>
</DIV>
|
|
|
|
|
Hi I am tring to read a xml in vs2005
my code keeps raising the following exception: "illegal characters in path"
here is the vb.net code:
Dim ds As New DataSet
ds.ReadXml(xmlout)
ds.WriteXml("C:\Query.xml")
here is the xml doc i am reading:
<?xml version="1.0" encoding="Windows-1252"?>
<InvQuery Language='05' CssStyle='' DecFormat='1' DateFormat='01' Role='01' Version='6.0.015'>
<StockItem>
<StockCode>R00001</StockCode>
<Description>POLYCARBONATE</Description>
<LongDesc>POLYCARBONATE RAW</LongDesc>
<AlternateKey1/>
<AlternateKey2/>
<Version/>
<Release/>
<StockUom>KG</StockUom>
<AlternateUom>GM</AlternateUom>
<ConvFactAltUom> 1000.000000</ConvFactAltUom>
<ConvMulDiv>D</ConvMulDiv>
<OtherUom>KG</OtherUom>
<ConvFactOthUom> 1.000000</ConvFactOthUom>
<MulDiv>M</MulDiv>
<StockAndAltUm>N</StockAndAltUm>
<PartCategory>B</PartCategory>
<Supplier/>
<ProductClass>POLY</ProductClass>
<Buyer/>
<Planner/>
<TraceableType>N</TraceableType>
<MpsFlag>N</MpsFlag>
<SupercessionDate/>
<DrawOfficeNum/>
<Ebq> 1.000</Ebq>
<DockToStock> 0</DockToStock>
<ManufLeadTime> 0</ManufLeadTime>
<TariffCode/>
<UserField1/>
<UserField2> 0.00000</UserField2>
<UserField3/>
<UserField4/>
<UserField5/>
<LeadTime> 5</LeadTime>
<WarehouseToUse>B2</WarehouseToUse>
<GrossReqRule>I</GrossReqRule>
<EccUser/>
<Mass> 0.000000</Mass>
<Volume> 0.000000</Volume>
<PriceCategory>A</PriceCategory>
<PriceMethod>C</PriceMethod>
<CycleCount> 0</CycleCount>
<TaxCode>B</TaxCode>
<OtherTaxCode/>
<ListPriceCode/>
<SerialMethod>N</SerialMethod>
<KitType>N</KitType>
<BulkIssueFlag>N</BulkIssueFlag>
<AbcClass/>
<StockMovementReq>Y</StockMovementReq>
<ClearingFlag>N</ClearingFlag>
<AbcAnalysisReq>Y</AbcAnalysisReq>
<AbcCostingReq/>
<CostUom>KG</CostUom>
<StockOnHold/>
<StockOnHoldReason/>
</StockItem>
<WarehouseItem>
<Warehouse>B2</Warehouse>
<Description>BRAESIDE RAW MATERIALS</Description>
<QtyOnHand> 14320.580</QtyOnHand>
<AvailableQty> 14320.580</AvailableQty>
<QtyOnOrder> 333500.000</QtyOnOrder>
<QtyInInspection> 0.000</QtyInInspection>
<MinimumQty> 0.000</MinimumQty>
<MaximumQty> 0.000</MaximumQty>
<QtyOnBackOrder> 0.000</QtyOnBackOrder>
<QtyAllocated> 0.000</QtyAllocated>
<MtdQtyReceived> 15000.000</MtdQtyReceived>
<MtdQtyAdjusted> -4418.896</MtdQtyAdjusted>
<MtdQtyIssued> 19229.420</MtdQtyIssued>
<YtdQtySold> 0.000</YtdQtySold>
<PrevYearQtySold> 209807.530</PrevYearQtySold>
<QtyInTransit> 0.000</QtyInTransit>
<QtyAllocatedWip> 83114.600</QtyAllocatedWip>
<MtdQtySold Height='000' Top=' 25535'> 0.000</MtdQtySold>
<MtdQtyTrf> 0.000</MtdQtyTrf>
<UserField1/>
<UserField2/>
<UserField3/>
<DefaultBin/>
<UnitCost> 4.96228</UnitCost>
<SalesQtyByMonth>
<SalesQty1 Height='061'> 15575.800</SalesQty1>
<SalesQty2 Height='062'> 15755.304</SalesQty2>
<SalesQty3 Height='065'> 16712.316</SalesQty3>
<SalesQty4 Height='063'> 16025.252</SalesQty4>
<SalesQty5 Height='061'> 15491.400</SalesQty5>
<SalesQty6 Height='072'> 18400.806</SalesQty6>
<SalesQty7 Height='067'> 17022.060</SalesQty7>
<SalesQty8 Height='044'> 11324.508</SalesQty8>
<SalesQty9 Height='052'> 13304.464</SalesQty9>
<SalesQty10 Height='100'> 25535.280</SalesQty10>
<SalesQty11 Height='095'> 24366.672</SalesQty11>
<SalesQty12 Height='091'> 23143.720</SalesQty12>
</SalesQtyByMonth>
</WarehouseItem>
<WarehouseItem>
<Warehouse>N2</Warehouse>
<Description>NORTHMEAD RAW MATERIALS</Description>
<QtyOnHand> 36998.000</QtyOnHand>
<AvailableQty> 36998.000</AvailableQty>
<QtyOnOrder> 148500.000</QtyOnOrder>
<QtyInInspection> 0.000</QtyInInspection>
<MinimumQty> 0.000</MinimumQty>
<MaximumQty> 0.000</MaximumQty>
<QtyOnBackOrder> 0.000</QtyOnBackOrder>
<QtyAllocated> 0.000</QtyAllocated>
<MtdQtyReceived> 35500.000</MtdQtyReceived>
<MtdQtyAdjusted> 825.408</MtdQtyAdjusted>
<MtdQtyIssued> 52752.000</MtdQtyIssued>
<YtdQtySold> 0.000</YtdQtySold>
<PrevYearQtySold> 406309.904</PrevYearQtySold>
<QtyInTransit> 0.000</QtyInTransit>
<QtyAllocatedWip> -46109.144</QtyAllocatedWip>
<MtdQtySold Height='000' Top=' 55367'> 0.000</MtdQtySold>
<MtdQtyTrf> 0.000</MtdQtyTrf>
<UserField1/>
<UserField2/>
<UserField3/>
<DefaultBin/>
<UnitCost> 5.01040</UnitCost>
<SalesQtyByMonth>
<SalesQty1 Height='074'> 41175.410</SalesQty1>
<SalesQty2 Height='100'> 55367.712</SalesQty2>
<SalesQty3 Height='055'> 30331.044</SalesQty3>
<SalesQty4 Height='058'> 32120.580</SalesQty4>
<SalesQty5 Height='044'> 24530.728</SalesQty5>
<SalesQty6 Height='067'> 37250.100</SalesQty6>
<SalesQty7 Height='063'> 34816.440</SalesQty7>
<SalesQty8 Height='063'> 35081.756</SalesQty8>
<SalesQty9 Height='058'> 32207.516</SalesQty9>
<SalesQty10 Height='073'> 40260.420</SalesQty10>
<SalesQty11 Height='065'> 36142.216</SalesQty11>
<SalesQty12 Height='064'> 35711.832</SalesQty12>
</SalesQtyByMonth>
</WarehouseItem>
</InvQuery>
Any help would be appreciated
Cheers
|
|
|
|
|
encoding="Windows-1252" might be the problem. I am not absolutely sure but I think System.Xml is expecting UTF-8 or UTF-16 encoding by default. You may need to read in the XML like the following:
StreamReader reader = new StreamReader(filename, Encoding.GetEncoding(1252));
This might help: http://support.microsoft.com/default.aspx?scid=kb;en-us;308061[^]
-- modified at 21:55 Thursday 28th September, 2006
|
|
|
|
|
Thanks George just tried no good.
I have made a small breathru if I remove the attributes on this line
<InvQuery Language='05' CssStyle='' DecFormat='1' DateFormat='01' Role='01' Version='6.0.015'>
to
<InvQuery>
It works perfectly.
The only problem is i make a call out to receive the xml from a extrenal program and am not sure how to remove those attributes prior to any processing in my code..
Can anyone help with my new problem >?
Cheers
One Big Problem!
|
|
|
|
|
Read the file into a stream reader
Read the streamreader into an XmlTextReader
Ds.Get(xsmltextreader)
that should format your string to Xml that the dataset can read
Hope this helped!
|
|
|
|
|
I have the schema as follows, but i can't seem to work out how to get attributes checked.
<?xml version="1.0"?><br />
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"<br />
targetNamespace="http://www.w3schools.com"<br />
xmlns="http://www.w3schools.com"<br />
elementFormDefault="qualified"><br />
<br />
<xs:element name="note"><br />
<xs:complexType><br />
<xs:sequence><br />
<xs:element name="Type" type="xs:string" default="FreeSpace"/><br />
<xs:element name="Obstical" type="xs:integer"/><br />
</xs:sequence><br />
<xs:attribute name="Type" type="xs:string" default="Debris"/><br />
</xs:complexType><br />
</xs:element><br />
</xs:schema>
doing it this way makes it put the attribute under the parent, if i try to put it in the element XMLspy say it is not valid.
i want Obstical to have a string type attribute, which defaults to debris
How would i define attributes for elements? all the tutotials give the attribute line eg
<xs:attribute name="Type" type="xs:string" default="Debris"/>
but not where i am supposed to put it in my schema.
|
|
|
|
|
check your post and Code Project guidlines for posting data with < and > characters
led mike
|
|
|
|
|
Hi,
I want to delete nodes in XML the problem is I'm using deleteSelf() but only a few nodes are deleted and not all here is the code:
foreach (XPathNavigator nav in navigator.Select("//book[@title='"+title+"']"))
{
nav.DeleteSelf();
}
doc.Save(filename);
|
|
|
|
|
I don't have time to work up your approach but why are you using XPathNavigator rather than the DOM?
"When your argument falls apart...resort to name-calling." Red Stateler aka (D)espeir in the Soapbox
Whereas "liberal" is just a moron. Red Stateler aka (D)espeir in the Soapbox
led mike
|
|
|
|
|
I tried with DOM also
node.ParentNode.removeChildNode(node);
still not deleting everything, somehow it skips some nodes
|
|
|
|
|
So you did this:
XmlNodeList list = doc.SelectNodes("//book[@title='test']");
foreach (XmlNode node in list)
node.ParentNode.RemoveChild(node);
doc.Save("myfile.xml");
and stepped through the loop in debug mode watching all the nodes get deleted but then after the file was saved some of the nodes where still there? I would need to see that happen to believe it.
led mike
|
|
|
|
|
Recently I made a project,in the project I need to transfer a big string(about 80MB) in WebService,but it give an exception,the message in the application log is:
"aspnet_wp.exe (PID: 3324) was recycled because memory consumption exceeded the 287 MB (60 percent of available RAM)."
How to fix the problem?
many thanx!
Bright Zhang
|
|
|
|
|
o,no reply
|
|
|
|
|
Folks,
Background
Because WiX has some outstanding bugs I need to create a custom action in VBScript to edit a previously installed web.config.
Problem
I have googled quite hard for a better understanding of the "Microsoft.XMLDOM" object but I am having real trouble getting my head around creating nodes, elements etc. My code finds stuff through XPath but never seems to be able to add anything
Help
Can anyone let me have some good links to some sites that give examples of either vbscript sites with examples or some advice in this regard
JBW
You can please some of the people all of the time and all of the people some of the time but not all of the people all of the time.
|
|
|
|
|
|
|
How do i capture double click event on the record displayed using XSL from database. I want to get the value in the cell on double click. Plz help
Srini
|
|
|
|
|
I assume you are talking about transforming an XML document into HTML using XSLT. I am also assuming that the values are displayed in a HTML table. In that case, you can use DHTML/Javascript to do what you want. In short, you are in the wrong forum to obtain what you want.
|
|
|
|
|
Hi,
This is my first XML experience so I need to ask a simple question. I created a test Studio.net webform with a sample XML file that has the following in it.
- xmlns:api="http://www.somesite.com/someapi
- xmlns:xsi="http://www.w3......
My question is when I run this project does the "xmlns:api" statement get called automatically? I'm trying to understand how the request starts and what you get back. Does someone know where I can find simple code that takes an XML file, gets the data from www.somesite.com for example, and returns back an XML reply?
Thank You
zxcvbnm
|
|
|
|
|
vfhgujaqwe wrote: - xmlns:api="http://www.somesite.com/someapi
- xmlns:xsi="http://www.w3......
These are just namespaces that usually refer to a schema.
vfhgujaqwe wrote: My question is when I run this project does the "xmlns:api" statement get called automatically? I'm trying to understand how the request starts and what you get back. Does someone know where I can find simple code that takes an XML file, gets the data from www.somesite.com for example, and returns back an XML reply?
I think you are looking for AJAX (XMLHTTP).
|
|
|
|
|
Hi,
I am having a lot of trouble trying to create an xml doc with a specific layout as it will be used by a flash file so needs to have a specific layout. So im just wondering if anyone has help or ideas of how to go about creating a file like this one
http://www.geocities.com/liverpool_anfieldreds/data.xml
I would really appreciate thanks in advance
Tim
|
|
|
|
|
Did you try Notepad?
led mike
|
|
|
|