|
How is it intelligent to post a question, and to respond when someone tries to get enough info out of you that they can help, by deleting your message ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
.NET 1.1
Working with the XmlValidatingReader object with an xsd in the XmlSchemCollection to validate a serialized version of a class.
I am getting this XmlSchemaException when I read through the stream to validate my XML.
"The 'TransactionMethod' element is not declared. An error occurred at , (22, 4)."
I am not an XSD expert and would like to get some feedback as to what may be the cause/solution of/for this exception. Included is an XSD that was generated from the actual class as well as the xml I am trying to validate.
---- XSD ----
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<xs:schema targetNamespace="urn:creditcardpaymentrequest-schema" xmlns="urn:creditcardpaymentrequest-schema" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"><br />
<xs:element name="CreditCardPaymentRequest" nillable="true" type="CreditCardPaymentRequest" /><br />
<xs:complexType name="CreditCardPaymentRequest"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="EPayPaymentRequest"><br />
<xs:sequence><br />
<xs:element minOccurs="0" maxOccurs="1" name="CreditCard" type="CreditCard" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="AuthorizationOnly" type="xs:boolean" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:complexType name="EPayPaymentRequest" abstract="true"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="EPayTransactionRequest"><br />
<xs:sequence><br />
<xs:element minOccurs="1" maxOccurs="1" name="IgnoreDuplicates" type="xs:boolean" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="RecurringIndicator" type="xs:boolean" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:complexType name="EPayTransactionRequest" abstract="true"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="BaseEntity"><br />
<xs:sequence><br />
<xs:element minOccurs="1" maxOccurs="1" name="CustomerId" type="xs:int" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="CustomerNumber" type="xs:string" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="TransactionId" type="xs:int" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="TransactionType" type="TransactionType" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="TransactionMethod" type="TransactionMethod" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="TransactionOrigin" type="TransactionOrigin" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="TransactionAmount" type="xs:decimal" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="ConvenienceFee" type="xs:decimal" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="ServiceOrderFee" type="xs:decimal" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="TotalAmount" type="xs:decimal" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="WaiveMinimumAmount" type="xs:boolean" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="WaiveConvenienceFee" type="xs:boolean" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="WaiveServiceOrderFee" type="xs:boolean" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="ContactName" type="xs:string" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="ContactNumber" type="xs:string" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="Note" type="xs:string" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:complexType name="BaseEntity" abstract="true"><br />
<xs:sequence><br />
<xs:element minOccurs="1" maxOccurs="1" name="DataStatus" type="EntityDataStatus" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="OldChangedValues" type="ArrayOfKeyValue" /><br />
</xs:sequence><br />
</xs:complexType><br />
<xs:simpleType name="EntityDataStatus"><br />
<xs:restriction base="xs:string"><br />
<xs:enumeration value="NewItem" /><br />
<xs:enumeration value="NewModified" /><br />
<xs:enumeration value="Modified" /><br />
<xs:enumeration value="NotModified" /><br />
<xs:enumeration value="Deleted" /><br />
</xs:restriction><br />
</xs:simpleType><br />
<xs:complexType name="ArrayOfKeyValue"><br />
<xs:sequence><br />
<xs:element minOccurs="0" maxOccurs="unbounded" name="KeyValue" nillable="true" type="KeyValue" /><br />
</xs:sequence><br />
</xs:complexType><br />
<xs:complexType name="KeyValue"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="BaseEntity"><br />
<xs:sequence><br />
<xs:element minOccurs="0" maxOccurs="1" name="Key" type="xs:string" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="Value" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:complexType id="TransactionMethod" name="TransactionMethod" abstract="true"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="BaseEntity"><br />
<xs:sequence><br />
<xs:element minOccurs="1" maxOccurs="1" name="CustomerId" type="xs:int" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="AccountId" type="xs:int" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="AccountNumber" type="xs:string" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="AccountLastFour" type="xs:string" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="NameOnAccount" type="xs:string" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="RecurringIndicator" type="xs:boolean" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="RecurringDocumentReceivedDate" type="xs:dateTime" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="RecurringStartDate" type="xs:dateTime" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="RecurringEndDate" type="xs:dateTime" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="ArEPayStatusId" type="xs:int" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="UpdateDate" type="xs:dateTime" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:complexType name="CreditCard"><br />
<xs:complexContent mixed="false"><br />
<xs:extension base="TransactionMethod"><br />
<xs:sequence><br />
<xs:element minOccurs="1" maxOccurs="1" name="CardType" type="CreditCardType" /><br />
<xs:element minOccurs="1" maxOccurs="1" name="ExpirationDate" type="xs:dateTime" /><br />
<xs:element minOccurs="0" maxOccurs="1" name="BillingZipCode" type="xs:string" /><br />
</xs:sequence><br />
</xs:extension><br />
</xs:complexContent><br />
</xs:complexType><br />
<xs:simpleType name="CreditCardType"><br />
<xs:restriction base="xs:string"><br />
<xs:enumeration value="Visa" /><br />
<xs:enumeration value="MasterCard" /><br />
<xs:enumeration value="Discover" /><br />
</xs:restriction><br />
</xs:simpleType><br />
<xs:simpleType name="TransactionType"><br />
<xs:restriction base="xs:string"><br />
<xs:enumeration value="Payment" /><br />
<xs:enumeration value="PaymentForReconnect" /><br />
<xs:enumeration value="PaymentForRestore" /><br />
<xs:enumeration value="Refund" /><br />
</xs:restriction><br />
</xs:simpleType><br />
<xs:simpleType name="TransactionOrigin"><br />
<xs:restriction base="xs:string"><br />
<xs:enumeration value="Collections" /><br />
<xs:enumeration value="BillStub" /><br />
<xs:enumeration value="WalkIn" /><br />
<xs:enumeration value="Recurring" /><br />
<xs:enumeration value="AdvancePayment" /><br />
</xs:restriction><br />
</xs:simpleType><br />
</xs:schema><br />
--- XML TO VALIDATE ---
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<CreditCardPaymentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><br />
<DataStatus>NewModified</DataStatus><br />
<OldChangedValues /><br />
<CustomerId>11270</CustomerId><br />
<CustomerNumber>119931004</CustomerNumber><br />
<TransactionId>0</TransactionId><br />
<TransactionType>Payment</TransactionType><br />
<TransactionOrigin>BillStub</TransactionOrigin><br />
<TransactionAmount>31</TransactionAmount> <br />
<ConvenienceFee>0</ConvenienceFee><br />
<ServiceOrderFee>0</ServiceOrderFee><br />
<TotalAmount>31</TotalAmount><br />
<WaiveMinimumAmount>false</WaiveMinimumAmount><br />
<WaiveConvenienceFee>false</WaiveConvenienceFee><br />
<WaiveServiceOrderFee>false</WaiveServiceOrderFee><br />
<ContactName>STEVE SMITH</ContactName><br />
<ContactNumber>9034547688</ContactNumber><br />
<IgnoreDuplicates>false</IgnoreDuplicates><br />
<RecurringIndicator>false</RecurringIndicator><br />
<AuthorizationOnly>false</AuthorizationOnly><br />
<TransactionMethod xsi:type="TransactionMethod"><br />
<DataStatus>NewModified</DataStatus><br />
<OldChangedValues /><br />
<CustomerId>11270</CustomerId><br />
<AccountId>0</AccountId><br />
<AccountNumber>5454545454545454</AccountNumber><br />
<AccountLastFour>5454</AccountLastFour><br />
<NameOnAccount>Test User</NameOnAccount><br />
<RecurringIndicator>false</RecurringIndicator><br />
<RecurringDocumentReceivedDate>0001-01-01T00:00:00.0000000-06:00</RecurringDocumentReceivedDate><br />
<RecurringStartDate>0001-01-01T00:00:00.0000000-06:00</RecurringStartDate><br />
<RecurringEndDate>0001-01-01T00:00:00.0000000-06:00</RecurringEndDate><br />
<ArEPayStatusId>0</ArEPayStatusId><br />
<UpdateDate>0001-01-01T00:00:00.0000000-06:00</UpdateDate><br />
<CardType>MasterCard</CardType><br />
<ExpirationDate>2010-10-10T00:00:00.0000000-05:00</ExpirationDate><br />
<BillingZipCode>77777</BillingZipCode><br />
</TransactionMethod> <br />
<CreditCard xsi:type="CreditCard"><br />
<DataStatus>NewModified</DataStatus><br />
<OldChangedValues /><br />
<CustomerId>11270</CustomerId><br />
<AccountId>0</AccountId><br />
<AccountNumber>5454545454545454</AccountNumber><br />
<AccountLastFour>5454</AccountLastFour><br />
<NameOnAccount>Test User</NameOnAccount><br />
<RecurringIndicator>false</RecurringIndicator><br />
<RecurringDocumentReceivedDate>0001-01-01T00:00:00.0000000-06:00</RecurringDocumentReceivedDate><br />
<RecurringStartDate>0001-01-01T00:00:00.0000000-06:00</RecurringStartDate><br />
<RecurringEndDate>0001-01-01T00:00:00.0000000-06:00</RecurringEndDate><br />
<ArEPayStatusId>0</ArEPayStatusId><br />
<UpdateDate>0001-01-01T00:00:00.0000000-06:00</UpdateDate><br />
<CardType>MasterCard</CardType><br />
<ExpirationDate>2010-10-10T00:00:00.0000000-05:00</ExpirationDate><br />
<BillingZipCode>77777</BillingZipCode><br />
</CreditCard> <br />
</CreditCardPaymentRequest><br />
thanks!
|
|
|
|
|
hi friends...
i am reading xml file but i am not able to write it in .txt file.
so please help me how to do it. and i am using c#.net
i want read xml file and generate xyz.txt file
thanks
manohar
manohar
|
|
|
|
|
adiveppanavar wrote: but i am not able to write it in .txt file.
Post the code that you are having trouble with and explain specifically what happens, what is wrong, what the problem is.
Also read this[^]. Pay attention to item #2.
led mike
|
|
|
|
|
string file = "D:\\sampleXML2.xml";
XmlTextReader reader = new XmlTextReader(file);
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
}
FileStream stream = new FileStream("D:\\manohar.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw = new StreamWriter(stream);
sw.WriteLine(reader.Value);
sw.Close();
stream.Close();
}
Console.WriteLine("Enter Any Key");
Console.ReadLine();
}
|
|
|
|
|
XmlDocument doc = new XmlDocument();
doc.Load("..\\..\\NavData.xml");
StreamWriter sw = new StreamWriter("MyData.txt");
XmlNodeList nodes = doc.SelectNodes("//text()");
foreach (XmlNode n in nodes)
sw.WriteLine(n.Value);
sw.Flush();
sw.Close();
led mike
|
|
|
|
|
Hi!
I have a file with next format
<root_xx xmlns="x-schema:mxschema://docsearch">
<docid>36511453
and have to extract from it a docID element with xpath
But when i'm trying to execute something like
/*/docID
it doesn't work.
Could you help me with maitaining xpath expression?
|
|
|
|
|
First your post is not accounting for the '<' and '>' characters. Pay attention to the posting guides on the screen to get them posted correctly.
Also are you using some XPath documentation to learn how XPath works? www.w3schools[^] is a good source.
led mike
|
|
|
|
|
Can anyone help me regarding generating XHTML dynamically using asp.net.........
Thanks in Advance
|
|
|
|
|
Reposting your questions is considered rude. If you have specific questions about the materials I pointed you to in your original thread you should use that thread to ask them.
Also perhaps you should read some CodeProject Guidelines[^]
led mike
|
|
|
|
|
Hi Mike .........
I didnt reposted the question.......
Please once go through these question thoroughly....
In the previoues post i posted the question as how to transform xml to XHTML...
and now the post is how to generate XHTML code Dynamically ..........
|
|
|
|
|
|
Dear all,
i have one table named ContactPerson in which there is one column named "PersonImg" which has a datatype - image and it stores image(.gif, .jpeg) in binary format.
Now i want to insert that table data into one XML file, but i get an error when i insert image data into XML.
Needed yr help.
Thanks in advance
Regards,
Rana k.j.
|
|
|
|
|
krish_rana16 wrote: Needed yr help.
Only because you refuse to study the subject yourself. There is an enormous amount of information available on the internet and probably even articles on this site that discuss and provide example code for doing just that. Lazy people who won't do their own work do not frequently find help here on CodeProject. In case you don't realize it, studying and reading documentation is part of a developers work.
led mike
|
|
|
|
|
Hi everyone:
I'm having trouble exporting the follow query to XML in a valid format. For some reason it wraps in the middle of a few elements causing .NET to say the end tag is missing. I'm using SQL '05 and when I show the query results in text the same exact thing happens.
Is it possible for to "Export to File" from within Management Studio and specify the format?
<br />
SELECT DISTINCT origin_location AS location<br />
FROM famis_locations<br />
WHERE origin_location <> ''<br />
ORDER BY origin_location<br />
FOR XML AUTO, ELEMENTS<br />
Thanks!
|
|
|
|
|
nickiii wrote: I'm having trouble exporting the follow query to XML
I'm assuming you mean inserting the SQL String as text into an XML TextNode yes?
nickiii wrote: For some reason .... causing .NET to say the end tag is missing.
you can't store text in XML that contains the lessthan and/or greaterthan ('<', '>') characters since they are XML syntax characters. There are various methods to account for this like using entities or encoding the string and then decoding it when you read it back into memory.
led mike
|
|
|
|
|
led mike wrote: I'm assuming you mean inserting the SQL String as text into an XML TextNode yes?
No. The posted query is what I use to get the locations from SQL. I want to export the location list to XML and read the XML with .NET. The query is actually being ran in Query Analyzer.
|
|
|
|
|
Ah, I should have figured that from the FOR XML, by bad.
However it's probably the same problem with the results from the query containing invalid XML Text characters.
You might find more detailed answers in places like this[^]
led mike
|
|
|
|
|
I Googled this issue earlier and that site came up. Just thought I'd take the easy way out hoping someone has tried the exact same thing as myself.
Thanks for responses led mike!
|
|
|
|
|
Hi
Can i anyone provide me the links for the conversion of XML to XHTML in .Net.
Thanks in Advance.
|
|
|
|
|
|
Hi,
I have created a XMLWeb Service and there is a class like this
class CUSTOMER
{
public string user;
public string password;
}
I have to used above two attributes in many classes inside the namespace .That 's why I have to declare them as public.
In addition , I need to hide above attributes when clients access my xmlwebservice. becasue those variables are using inside the namespace classes only.
abcservice lobjservice=new abcservice()
lobjservice.customer.user="";
lobjservice.customer.password="";
How do I hide 'user' and 'password' ,when we are accessing the service?
|
|
|
|
|
Hi....
I have a XML file which contains text and encoded waveforms of an ECG....
We had extracted the text, but we don't know to extract the waveform...
Please give a sample code to decode it...
Please reply as soon as possible...
|
|
|
|
|
Hi,
I am developing RDLC (Report) using XSD dataset. I have one doubt is that suppose multiple users display at a time report then can be it possible data show duplicate, because i am using XSD and its store as a XML. Means if users show parallel reports then all users show according to user select criteria and not all users show same reports because i am using XSD. I think you all understand my problem. Any suggestion? One more problem is that when i am insert new field or delete field from table then XSD not updated frequently and also report not show that updated fields. I am currently writing manually in XML file of report for update field related entry. Means updation in database table not update in XSD or Report.
Thanks
Do hard work, you will get result sure !
|
|
|
|
|
I have a code that get a record on table using xsl since my fields are dynamic I dont have the exact name of the field, Intead of the field name I'm thinking if I can use the index of the table to get the record
My sample code
<xsl:for-each select="NewDataSet/Info">
<xsl:value-of select="FIRST_NM"><xsl:value-of select="MIDDLE_NM"><xsl:value-of select="LAST_NM"><xsl:value-of select="ADDRESS"><xsl:value-of select="TEL">How can I change the field name into index field?
Thanks
|
|
|
|