 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
hi guys.i want to generate html tree from xml file using xslt.. how can i do tht.. i have tried plenty of examples from net.. but didnt get the correct.. code... plz reply.. regards,
|
|
|
|
 |
|
 |
How to open Zip file and Xls files
|
|
|
|
 |
|
 |
In what language, for what purpose?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
 |
|
 |
Hi,
I am trying to implement Apriori Algorithm(Mining Association Rules from XML Data) with XQuery. Unfortunately, I am not familiar with XQuery language. So, I need your help to fix the bug in the code given below
xquery version "1.0";
declare function apriori($l, $L, $minsup, $total, $src)
{
let $C := removeDuplicate(candidateGen($l))
let $l := getLargeItemsets($C, $minsup, $total, $src)
let $L := $l union $L
return if (empty($l)) then
$L
else
apriori($l, $L, $minsup, $total, $src)
}
let $src := doc(/transactions.xml)//items
let $minsup := 0.4
let $total := count($src) * 1.00
let $C := distinct-values($src/*)
let $l :=(for $itemset in $C
let $items := (for $item in $src/*
where $itemset = $item
return $item)
let $sup := (count($items) * 1.00) div $total
where $sup >= $minsup
return <largeItemset>
<items> {$itemset} </items>
<support> {$sup} </support>
</largeItemset>)
let $L := $l
return <largeItemsets> {apriori($l, $L,$minsup, $total, $src)}
</largeItemsets>
Error:
[DataDirect][XQuery][err:XPST0003]Error at line 14, column 1. Expected ";", but encountered "let"
Thanks for any help
|
|
|
|
 |
|
 |
Hi,
My Sample XML is as follows:
<Students>
<Student>
<roll id="1" />
<StudName id="stud1" />
<Class1 val="cls1" />
<Class2 val="cls2" />
<Class3 val="cls3" />
<Class4 val="cls4" />
<Class5 val="cls5" />
<Class6 val="cls6" />
</Student>
<Student>
<roll id="2" />
<StudName id="stud2"/>
<Class1 val="cls7" />
<Class2 val="cls8" />
<Class3 val="cls9" />
<Class4 val="cls10" />
<Class5 val="cls11" />
<Class6 val="cls12" />
</Student>
<Student>
<roll id="3" />
<StudName id="stud3" />
<Class1 val="cls13" />
<Class2 val="cls14" />
<Class3 val="cls15" />
<Class4 val="cls16" />
<Class5 val="cls17" />
<Class6 val="cls18" />
</Student>
<Student>
<roll id="4" />
<StudName id="stud4" />
<Class1 val="cls19" />
<Class2 val="cls20" />
<Class3 val="cls21" />
<Class4 val="cls22" />
<Class5 val="cls23" />
<Class6 val="cls24" />
</Student>
<Student>
<roll id="5" />
<StudName id="stud5" />
<Class1 val="cls25" />
<Class2 val="cls26" />
<Class3 val="cls27" />
<Class4 val="cls28" />
<Class5 val="cls29" />
<Class6 val="cls30" />
</Student>
</Students>
Now i need to prepare XSLT such that if nodes are more than 3 then i need to get only roll and studname nodes.
I need to get the result as
<Students>
<Student>
<roll id="1" />
<StudName id="stud1" />
</Student>
<Student>
<roll id="2" />
<StudName id="stud2"/>
</Student>
<Student>
<roll id="3" />
<StudName id="stud3" />
</Student>
<Student>
<roll id="4" />
<StudName id="stud4" />
</Student>
<Student>
<roll id="5" />
<StudName id="stud5" />
</Student>
</Students>
Please provide me the required XSLT such that i need to get the above output...
Thanks in advance
Harini
|
|
|
|
 |
|
 |
I don't understand;
harinit wrote: if nodes are more than 3
From your input and output it looks as if you are doing nothing more than removing all the ClassX nodes.
Every man can tell how many goats or sheep he possesses, but not how many friends.
|
|
|
|
 |
|
 |
Hi i am sorry for not explaining correctly...
My sample xml is as follows:
<Students>
<Student>
<roll id="1" />
<StudName id="stud1" />
<Class1 val="cls1" />
<Class2 val="cls2" />
<Class3 val="cls3" />
<Class4 val="cls4" />
<Class5 val="cls5" />
<Class6 val="cls6" />
</Student>
<Student>
<roll id="2" />
<StudName id="stud2"/>
<Class1 val="cls7" />
<Class2 val="cls8" />
<Class3 val="cls9" />
<Class4 val="cls10" />
<Class5 val="cls11" />
<Class6 val="cls12" />
</Student>
<Student>
<roll id="3" />
<StudName id="stud3" />
<Class1 val="cls13" />
<Class2 val="cls14" />
<Class3 val="cls15" />
<Class4 val="cls16" />
<Class5 val="cls17" />
<Class6 val="cls18" />
</Student>
<Student>
<roll id="4" />
<StudName id="stud4" />
<Class1 val="cls19" />
<Class2 val="cls20" />
<Class3 val="cls21" />
<Class4 val="cls22" />
<Class5 val="cls23" />
<Class6 val="cls24" />
</Student>
<Student>
<roll id="5" />
<StudName id="stud5" />
<Class1 val="cls25" />
<Class2 val="cls26" />
<Class3 val="cls27" />
<Class4 val="cls28" />
<Class5 val="cls29" />
<Class6 val="cls30" />
</Student>
</Students>
We need to get the length of xml node including child nodes.
Suppose if the length of xml exceeds the configured length then it should be formatted as small xml file with root elements.
Example: consider the node(including child nodes) exceedes the length 100 then we should format the xml as given below using XSLT.
<Students>
<Student>
<roll id="1" />
<StudName id="stud1" />
<Class1 val="cls1" />
<Class2 val="cls2" />
<Class3 val="cls3" />
<Class4 val="cls4" />
<Class5 val="cls5" />
<Class6 val="cls6" />
</Student>
</Students>
<Students>
<Student>
<roll id="2" />
<StudName id="stud2"/>
<Class1 val="cls7" />
<Class2 val="cls8" />
<Class3 val="cls9" />
<Class4 val="cls10" />
<Class5 val="cls11" />
<Class6 val="cls12" />
</Student>
</Students>
|
|
|
|
 |
|
 |
Dear readers,
for an xml-file I creat the corresponding schema-file (.xsd) in two ways: a) with VStudio and b) with the tool "xsd.exe"
Both results are in some way different. e.g. at data-types or at the label "minoccurs". It seems not to be so dramatic.
But, I use these schema-files for xmlmaps in excel, and here I have a dramatic impact. I get totally different behavior for both xsd-version.
Does anybody know, why both tools give a different result?
For my use-case, the VStudio-generated xsd is better, but how can I access is without Vstudio?
Thanks in advance
|
|
|
|
 |
|
 |
How do i check if a certain value exists?
For example, if my document looks like this:
<Systems>
<systemData>
<name>Name1</name>
<status>Active</status>
<slot>0</slot>
</systemData>
<systemData>
<name>Name2</name>
<status>Active</status>
<slot>1</slot>
</systemData>
</Systems>
how would i query the document to see if "Name1" exists?
|
|
|
|
 |
|
 |
Hi,
You can use XPath for this.
Below is a code snippet:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"C:\SystemX.xml");
string xPath = "/Systems/systemData[name='Name5']"; XmlNode xmlNode = xmlDoc.SelectSingleNode(xPath);
if (xmlNode == null)
{
MessageBox.Show("Name5 not found");
}
Hope this helps.
Good luck!
Integrity is telling myself the truth. And honesty is telling truth to other people.
My Blog![ ^]
|
|
|
|
 |
|
 |
Hello everyone,
I have an xml file name is questions.xml, I am checking these questions by using .xsd file but I need to load them in to jquery flipcard in order to show them on the html file, I will paste my questions.xml file here so could you please help me how to load these questions one by one using jquery flipcard and xml file?
questions.xml
<option correct="yes">Statement of Intent</option>
<option>Cut-off Claim</option>
<option>Indian Reserve</option>
<option>Treaty Right</option>
<option>Esquimalt & Nanaimo Railway</option>
<option>Fiduciary Duty</option>
<option correct="yes">Douglas Treaties</option>
<option>Indian Act</option>
<option>Indian Reserve</option>
<option>Esquimalt & Nanaimo Railway</option>
<option>Band</option>
<option>Section 35</option>
<option>First Nation</option>
<option>Band Council</option>
<option>Statement of Intent</option>
<option>Cut-off Claim</option>
<option>Esquimalt & Nanaimo Railway</option>
<option>Fiduciary Duty</option>
<option>Statement of Intent</option>
<option>Cut-off Claim</option>
<option>Indian Reserve</option>
<option>Section 35</option>
<option>Indian Act</option>
<option>First Nation</option>
<option>Indian Reserve</option>
<option>Douglas Treaties</option>
<option>Band</option>
<option>Indian Act</option>
<option>Indian Reserve</option>
<option>Band</option>
<option>Fiduciary Duty</option>
<option>First Nation</option>
<option>First Nation</option>
<option>Statement of Intent</option>
<option>Band Council</option>
<option>Indian Reserve</option>
<option>Treaty Right</option>
<option>Statement of Intent</option>
<option>Treaty</option>
<option>Section 35</option>
<option>Cut-off Claim</option>
<option>Treaty Right</option>
<option>First Nation</option>
<option>Indian Reserve</option>
<option>Indian Act</option>
<option>Treaty</option>
<option>Band Council</option>
<option>Treaty Right</option>
<option>Section 35</option>
<option>Band</option>
<option>First Nation</option>
<option>Statement of Intent</option>
<option>Statement of Intent</option>
<option>Readiness</option>
<option>Interim Measures</option>
<option>INAC (Indian & Northern Affairs)</option>
<option>Interim Measures</option>
<option>First Nation</option>
<option>Main Table</option>
<option>Ministry of Aboriginal Affairs (MAA)</option>
<option>INAC (Indian & Northern Affairs)</option>
<option>Unity Protocol</option>
<option>Ministry of Aboriginal Affairs (MAA)</option>
<option>Readiness</option>
<option>Unity Protocol</option>
<option>British Columbia Treaty Commission (BCTC)</option>
<option>Hul'qumi'num Treaty Group</option>
<option>First Nations Summit</option>
<option>Hul'qumi'num Treaty Group</option>
<option>INAC (Indian & Northern Affairs)</option>
<option>British Columbia Treaty Commission (BCTC)</option>
<option>Third Parties</option>
<option>Unity Protocol</option>
<option>Main Table</option>
<option>Interim Measures</option>
<option>Hul'qumi'num Treaty Group</option>
<option>INAC (Indian & Northern Affairs)</option>
<option>Hul'qumi'num Treaty Group</option>
<option>Ministry of Aboriginal Affairs (MAA)</option>
<option>Unity Protocol</option>
<option>Hul'qumi'num Treaty Group</option>
<option>Third Parties</option>
<option>Ministry of Aboriginal Affairs (MAA)</option>
<option>Interim Measures</option>
<option>Main Table</option>
<option>British Columbia Treaty Commission (BCTC)</option>
<option>Unity Protocol</option>
<option>Hul'qumi'num Treaty Group</option>
<option>Ministry of Aboriginal Affairs (MAA)</option>
<option>Interim Measures</option>
<option>Third Parties</option>
<option>First Nations Summit</option>
<option>Framework Agreement</option>
<option>Land-based Jurisdictional Model</option>
<option>Land Tenure</option>
<option>RFiscal Arrangements</option>
<option>Aboriginal Rights</option>
<option>Expropriation</option>
<option>Treaty Mandates</option>
<option>Extinguishment</option>
<option>Aboriginal Title</option>
<option>Land-based Jurisdictional Model</option>
<option>Crown Grant</option>
<option>Expropriation</option>
<option>Aboriginal Rights</option>
<option>Land Tenure</option>
<option>Fiscal Arrangements</option>
<option>Treaty Mandates</option>
<option>Extinguishment</option>
<option>Aboriginal Rights</option>
<option>Framework Agreement</option>
<option>Expropriation</option>
<option>Land Tenure</option>
<option>Aboriginal Title</option>
<option>Extinguishment</option>
<option>Aboriginal Rights</option>
<option>Treaty Mandates</option>
<option>Land-based Jurisdictional Model</option>
<option>Expropriation</option>
<option>Extinguishment</option>
<option>Aboriginal Rights</option>
<option>Crown Grant</option>
<option>Treaty Mandates</option>
<option>Aboriginal Title</option>
<option>Land Tenure</option>
<option>Extinguishment</option>
<option>Aboriginal Title</option>
<option>Crown Grant</option>
<option>Aboriginal Title</option>
<option>Framework Agreement</option>
<option>Expropriation</option>
<option>Fiscal Arrangements</option>
<option>Overlaps</option>
<option>Crown Activity</option>
<option>Agreement in Principle (AIP)</option>
<option>Traditional Territory</option>
<option>Food Fish</option>
<option>Traditional Territory</option>
<option>Crown Tenure</option>
<option>Underlying Title</option>
<option>Food Fish</option>
<option>Crown Activity</option>
<option>Crown Tenure</option>
<option>Underlying Title</option>
<option>Traditional Territory</option>
<option>Crown Land</option>
<option>Food Fish</option>
<option>Land Quantum</option>
<option>Agreement in Principle (AIP)</option>
<option>Crown Tenure</option>
<option>Sub-surface</option>
<option>Underlying Title</option>
<option>Crown Activity</option>
<option>Traditional Territory</option>
<option>Crown Land</option>
<option>Sub-Surface</option>
<option>Sub-surface</option>
<option>Agreement in Principle (AIP)</option>
<option>Food Fish</option>
<option>Crown Activity</option>
<option>Food Fish</option>
<option>Traditional Territory</option>
<option>Crown Activity</option>
<option>Underlying Title</option>
<option>Crown Land</option>
<option>Land Quantum</option>
<option>Crown Tenure</option>
<option>Crown Activity</option>
<option>Overlaps</option>
<option>Crown Land</option>
<option>Sub-surface</option>
<option>Land Quantum</option>
<option>Final Agreement</option>
<option>Constitution</option>
<option>Expropriation</option>
<option>Indemnity</option>
<option>Expropriation</option>
<option>Citizenship Code</option>
<option>Eligibity</option>
<option>Compensation</option>
<option>Citizenship Code</option>
<option>Constitution</option>
<option>Compensation</option>
<option>Final Agreement</option>
<option>Eligibity</option>
<option>Self-Government</option>
<option>Citizenship Code</option>
<option>Indemnity</option>
<option>Compensation</option>
<option>Eligibity</option>
<option>Constitution</option>
<option>Final Agreement</option>
<option>Constitution</option>
<option>Final Agreement</option>
<option>Eligibity</option>
<option>Expropriation</option>
<option>Compensation</option>
<option>Final Agreement</option>
<option>Constitution</option>
<option>Citizenship Code</option>
<option>Citizenship Code</option>
<option>Constitution</option>
<option>Eligibity</option>
<option>Indemnity</option>
<option>Jurisdiction</option>
<option>Legal Uniformity</option>
<option>Implementation</option>
<option>Ratification</option>
<option>Resource-revenue Sharing</option>
<option>Ratification</option>
<option>Cooperative Management</option>
<option>Specific Claim</option>
<option>Financial Transfer Arrangements</option>
<option>Treaty Settlement Land</option>
<option>First Nations Roads</option>
<option>Legal Uniformity</option>
<option>Jurisdiction</option>
<option>Resource-revenue Sharing</option>
<option>Cooperative Management</option>
<option>Treaty Settlement Land</option>
<option>First Nations Roads</option>
<option>Resource-revenue Sharing</option>
<option>Capacity-building</option>
<option>Implementation</option>
<option>Treaty Settlement Land</option>
<option>Legal Uniformity</option>
<option>Resource-revenue Sharing</option>
<option>Cooperative Management</option>
<option>Treaty Settlement Land</option>
<option>Jurisdiction</option>
<option>Cooperative Management</option>
<option>Legal Uniformity</option>
<option>Ratification</option>
<option>Resource-revenue Sharing</option>
<option>Specific Claim</option>
<option>Financial Transfer Arrangements</option>
<option>Implementation</option>
<option>First Nations Roads</option>
<option>Financial Transfer Arrangements</option>
<option>Capacity-building</option>
<option>Treaty Settlement Land</option>
<option>Financial Transfer Arrangements</option>
<option>First Nations Roads</option>
<option>Cooperative Management</option>
<option>Resource-revenue Sharing</option>
<option>Financial Transfer Arrangements</option>
<option>Specific Claim</option>
<option>Jurisdiction</option>
|
|
|
|
 |