|
Hi all
I have XML document and I need to add gif file.
I dont now XML and can you help me.
|
|
|
|
|
david bagaturia wrote: I dont now XML and can you help me.
Did you try Google[^]
or maybe this would help more[^]
led mike
|
|
|
|
|
Hmmm, an explicit display of tough love. Someone will need a man hug after this.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
You can use Base64 or quadrosexagesimal! Please use Google to find more information.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
I'm trying to serialise a graph structure to XML.
Everything is working fine except for one object which is alwasy coming out as an empty element. Even if I serialise it on its own. Its the most important object as it represents the link. Any idea why it wouldn't show any attributes?
Heres the code:
<br />
[Serializable()]<br />
[System.Xml.Serialization.XmlInclude(typeof(ParticipantNode))]<br />
public class EdgeToNeighbour<br />
{<br />
#region Private Member Variables<br />
private string id;<br />
private Node neighbour;<br />
#endregion<br />
<br />
#region Constructors<br />
public EdgeToNeighbour() <br />
{<br />
}<br />
<br />
public EdgeToNeighbour(Node neighbour)<br />
{<br />
this.neighbour = neighbour;<br />
this.id = neighbour.Key;<br />
}<br />
#endregion<br />
<br />
#region Properties<br />
public Node Neighbour<br />
{<br />
get<br />
{<br />
return neighbour;<br />
}<br />
}<br />
public string ID<br />
{<br />
get{return id;}<br />
}<br />
#endregion<br />
}<br />
I've tried ignoring the complex type, i've tried adding XML text, I've tried lots of different combinations of XmlAttribute etc. but i always end up with this:
Serialised on its own:
<br />
<EdgeToNeighbour xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /><br />
Serialised as part of the graph structure:
<br />
<anyType xsi:type="Node"><br />
<Data><br />
<ID>2</ID><br />
<TypeID>0</TypeID><br />
<Name>A Node</Name><br />
</Data><br />
<Edges><br />
<EdgeToNeighbour /><br />
<EdgeToNeighbour /><br />
</Edges><br />
</anyType><br />
All I want is for edge to neighbour object to show the attribute ID so I can see the nodes it is linked to.
Thanks in advance.
Rob.
|
|
|
|
|
All of you properties are either private or read only. Only public read/write properties are serialized unless you implement the ISerializable interface(which lets you determine exactly how your class is serialized).
-- modified at 20:58 Wednesday 23rd May, 2007
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
i am using sitemap control to navigate through site. Plse suggest me to traverse .
I mean root+child+sublings..home>News> which looks like this and how to create the sitemap file or xml to traverse.....help me plse
came out of hardwork
|
|
|
|
|
I'm creating a typed DataSet for my XML file and I'm having trouble modifying the XSD file to conform to my data's format. Here's a sample of my data:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<dropdowns>
<Country lang="en">Albania</Country>
<Country lang="en">Algeria</Country>
...
I need for my Country data table to have two columns: "lang" and "name". How do I set up the XSD to treat the contents of the Country element as my name column? I've tried this, but it's not working:
<xs:element name="Dropdowns" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Dropdowns" msprop:Generator_DataSetName="Dropdowns">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Country" form="unqualified" msprop:Generator_UserTableName="Country" msprop:Generator_RowDeletedName="CountryRowDeleted" msprop:Generator_RowChangedName="CountryRowChanged" msprop:Generator_RowClassName="CountryRow" msprop:Generator_RowChangingName="CountryRowChanging" msprop:Generator_RowEvArgName="CountryRowChangeEvent" msprop:Generator_RowEvHandlerName="CountryRowChangeEventHandler" msprop:Generator_TableClassName="CountryDataTable" msprop:Generator_TableVarName="tableCountry" msprop:Generator_RowDeletingName="CountryRowDeleting" msprop:Generator_TablePropName="Country">
<xs:complexType name="name" form="unqualified" msprop:Generator_UserColumnName="name" msprop:nullValue="_empty" msprop:Generator_ColumnPropNameInRow="name" msprop:Generator_ColumnPropNameInTable="nameColumn" msprop:Generator_ColumnVarNameInTable="columnname" type="xs:string" default="">
<xs:attribute name="lang" form="unqualified" msprop:Generator_UserColumnName="lang" msprop:nullValue="_throw" msprop:Generator_ColumnPropNameInRow="lang" msprop:Generator_ColumnPropNameInTable="langColumn" msprop:Generator_ColumnVarNameInTable="columnlang" type="xs:string" msdata:DefaultValue="en" use="required" />
</xs:complexType>
</xs:element>
How do I fix the part in bold?
Thanks!
Alvaro
Eat right. Exercise. Die anyway.
|
|
|
|
|
Hi All,
I am sure the solution to this is *Really* easy, but i've been staring at it for a while now and have got nowhere. I've written the test below in both C# and VB and both do the same thing.
I need to use an XmlReader object to read in an xml document. Note that it is essential that i use an XmlReader object as I need to perform schema validation. The code below does not incluse schema validation as as this stage i'm just trying to get an xml file into an XmlReader.
Looking in the msdn and a range of examples in google i should be able to get an XmlReader object containing my xml document by using XmlReader.Create(TextReader o). Everything is working right up until that step, but using the debug tools my XmlReader object appears to remain content-less. Here's the code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;
namespace XmlTest
{
class Program
{
static void Main(string[] args)
{
String file = "C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\CONFIG\\web.config";
XmlDocument doc = new XmlDocument();
doc.Load(new System.IO.StreamReader(file));
String docString = doc.OuterXml;
TextReader tr = new StringReader(docString);
XmlReader xr = XmlReader.Create(tr);
System.Console.ReadKey();
}
}
}
So we're loading in an xml file, putting it into an XmlDocument and getting the Xml as a string out of it. This is because ultimately when i slot this work back into what i'm doing i'll be obtaining the xml document via a string.
A TextReader object is then created from the string via a StringReader. If i debug the code i can see the document correctly loaded into the TextReader (tr) in it's entirity. It just doesn't seem to be converted into an XmlReader object via XmlReader.Create(tr).
Similarly, if i replace XmlReader.Create(tr) with XmlReader.Create(new System.IO.StreamReader(file)) I have the same problem, proving it's none of the logic inbetween that is messing things up.
What am i missing about XmlReader? Please help if you can, this is driving me absolutely nuts. When i look at it in debug the object has a depth of zero and looking in items i see "In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user." I have no idea what this means and google doesn't help.
You should be able to copy and paste the code and replicate the issue easily.
Many thanks,
Rolf
|
|
|
|
|
I think the problem is that the reader isn't position on an XML node after being created, so you'll have to call any Read method before the properties (e.g. depth) return any useful information.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks Stefan, that was the problem. I'd been expecting the debug fields to populate as soon as the object had been created but as you say, running a ReadToEnd populated the fields.
Thanks,
Rolf
|
|
|
|
|
My web method returns some XML as a string. I have a fairly simple XSLT file (trying to create HTML SELECT OPTION tags from the XML content). I think both are OK but I cannot figure out how to pass the string of XML to the Transform method and get my desired output streamed out to the web page.
<code>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myProxyClass As New ServicesMDW.Service
Dim countiesXML As String
Dim xslt As New XslCompiledTransform()
Dim xpathdoc As XPathDocument
Dim xslFileName As String = Server.MapPath("UserControl_StateCounty.xsl")
Try
countiesXML = myProxyClass.GetCountiesForState("06", "P", "Guest")
xpathdoc = New XPathDocument(countiesXML)
xslt.Load(xslFileName)
xslt.Transform(xpathdoc, Nothing, Response.OutputStream)
Catch ex As Xsl.XsltException
Trace.Write("Transform Failed")
Catch ex As Exception
Trace.Write(ex.Message)
End Try
End Sub
</code>
Here is the XSLT file "UserControl_StateCounty.xsl":
<code>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div id="divCounty">
<label for="ddCounty">Select County</label>
<select id="ddCounty" >
<xsl:for-each select="Counties/County">
<option value="{County_Cd}"><xsl:value-of select='TypeCounty' /></option>
</xsl:for-each>
</select>
</div>
</xsl:template>
</xsl:stylesheet>
</code>
Here is a snippet of the XML returned from web method:
<code>
<Counties> <County> <County_Cd>001</County_Cd> <TypeCounty>Alameda</TypeCounty> <State_cd>06</State_cd> </County> <County> <County_Cd>005</County_Cd> <TypeCounty>AMADOR</TypeCounty> <State_cd>06</State_cd> </County></Counties>
</code>
John
|
|
|
|
|
Hi All
I am trying to generate code from one of my xml schema using Xsd.exe.
it throws the following error:
C:\>xsd C:\statement.xsd /c /l:cs
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Error generating classes for schema 'C:\statement'.
- Group 'value' from targetNamespace='http://www.xyz.com/statement' has invalid definition: Circular group reference.
If you would like more help, please type "xsd /?".
Is there any solution for the problem with Circular group reference?
Gokulan
|
|
|
|
|
All,
what is the equvalent of in xsl i want to break a line what should i have to use....
Thanks
Vikas
|
|
|
|
|
Did you try google?
http://www.xml.com/pub/a/2001/12/05/whitespace.html[^]
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I use
<xsl:text> </xsl:text>
|
|
|
|
|
Hi ,
Im trying to transform an xml document with a style sheet that includes a vbscript file with vb script functions, using .net 1.1 and vb.net i get the following error when the code block attempts to transform the xml file.
The scripting language 'vbscript' is not supported.
Ive googled with very little help can someone please offer me a solution or advice !!
From my understanding this is .net security kicking in by not allowing server side scripts being included which may contain bad code nice but in this case its not helping me, in this case my intentions are good so i need this script to be trusted
Thank you in advance.
|
|
|
|
|
I am having a weird problem while validating an XML file against its schema. I am setting XmlReaderSettings to xml schema, add the ValidationEventHandler and then create the xml reader. But it throws an exception:
------------------
A first chance exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll
validate function threw an exception of type 'System.Xml.Schema.XmlSchemaValidationException'
base {System.Xml.Schema.XmlSchemaException}: {"It is an error for both 'length' and either 'minLength' or 'maxLength' to be members of {facets}, unless they are specified in different derivation steps. In which case the following must be true: the {value} of 'minLength' <= the {value} of 'length' <= the {value} of 'maxLength'."}
SourceObject: null
-----------------------
I have validated the same xml file against the same schema using Oxygen XML Editor and XML Spy and these tools consider it a valid document.
Now after that I opened the schema in VS 2005, it underlines the xsd:length attribute and tootip gives the same error. But the above mentioned third party tools consider it valid attribute.
Any thoughts will be highly appreciated
-----
|
|
|
|
|
|
hello gentlemen, im new at web services
all i've acomplished to do is to make the web reference...
the web reference i made of a web service that returns an xml
im sure of that because in the details page when i press invoke it returns a very large xml
my question is how to take that xml from the web service and somehow save it into the computer and transform it to be used by a dataset to feed a datagrid using windows forms in visual basic 2003 language visual basic
i've read a lot about web services but im alittle bit confused about all the xml things
the xml writters readers readxml etc (its simply confusing)
help is apreciated
thanks for your time
an expample of the xml that returns is here:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://services.naves.digmer.com/types/">
<env:Body>
<ns0:getNavesNavegandoResponseElement>
<ns0:result>
<naves>
<nave>
<nodo name="nombre">100PRE MI ROBERT</nodo>
<nodo name="senal_llamada">HC2733</nodo>
<nodo name="id_pais">EQA</nodo>
<nodo name="tb">22.61</nodo>
<nodo name="id_puerto_zarpe">2</nodo>
<nodo name="id_puerto_arribo">1170</nodo>
<nodo name="id_puerto_proximo"></nodo>
<nodo name="fecha_zarpe">10-04-2007 08:00:00</nodo>
<nodo name="fecha_estimada_arribo">09-05-2007 10:00:00</nodo>
<qth>
<nodo name="latitud">-0.8500000000</nodo>
<nodo name="longitud">-80.7000000000</nodo>
<nodo name="rumbo">0</nodo>
<nodo name="velocidad">0</nodo>
</qth>
<nodo name="estado">NAV</nodo>
</nave>
<nave>
<nodo name="nombre">2 MUJERES J.M.</nodo>
<nodo name="senal_llamada"></nodo>
<nodo name="id_pais">EQA</nodo>
<nodo name="tb">1.83</nodo>
<nodo name="id_puerto_zarpe">1</nodo>
<nodo name="id_puerto_arribo">1065</nodo>
<nodo name="id_puerto_proximo"></nodo>
<nodo name="fecha_zarpe">02-04-2007 09:00:00</nodo>
<nodo name="fecha_estimada_arribo">17-04-2007 06:00:00</nodo>
<qth>
<nodo name="latitud">-2.2297222222</nodo>
<nodo name="longitud">-79.8738888889</nodo>
<nodo name="rumbo">0</nodo>
<nodo name="velocidad">0</nodo>
</qth>
<nodo name="estado">NAV</nodo>
</nave>
:
:
'
</naves>
</ns0:result>
</ns0:getNavesNavegandoResponseElement>
</env:Body>
</env:Envelope>
"everything is possible"
|
|
|
|
|
i also get the same error about
System.Xml.dll
somehow the idea to try
dataset1.readxml(file.xml)<br />
datagrid1.datasource = dataset1
only gives me trouble
if i cant load an xml from a file, how is it possible to get it from a web service
and im starting to worry about that
|
|
|
|
|
Will you be so kind to tell me how do you search with xml using aspnet 2003.
Romeo
|
|
|
|
|
What do you mean by search with XML?
If you want to access a specific element or attribute of an XML file use XPath[^].
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi
How to create a dynaic XSD
its very urgent
thank u
kishore kumar Manikonda
Software Developer
|
|
|
|