|
aliaskain wrote: i dont want the outer tag
Without the outer tag it's not valid XML. If you are new to using XML I strongly suggest you study the subject to gain an understanding of it before you try to use it in software projects.
led mike
|
|
|
|
|
im sorry that i did not write the whole xml here
it has an outer tag like
<Abc>
......
</Abc>
in this tag it writes those that i wrote first
i wanted to say it writes 1 more tag <HISDepartments>
under Abc i want other elements
|
|
|
|
|
As part of my program I should create a XML file and it should contain a URL. That URL is containing '&' sign. Whenever I put '&' sign in XML file, Internet exploerer is not taking it and showing error
Following is a simple XML file
<pharmacy name="PChek.com" country="Canada">
<drugs>
<drug name="APO-DILTIAZ CD" unit="CAPSULE" affiliateid="https://www.interna.com/cgi-bin/ncommerce3/input?ProductName=DILTIAZ CD&groupid=RPC" ndc="" />
</drugs>
</pharmacy>
Once I open this XML file in the IE, it gives following error "
A semi colon character was expected. Error processing resource
If I remove the & sign from the url, then XML file is opening and working fine
How to solve this problem? Please let me know
|
|
|
|
|
you show encode "&" to "&" in xml
then your problem would be solved.
------------------------------------------------------------
Logiclabz
modified on Thursday, March 26, 2009 3:11 AM
|
|
|
|
|
Replace & with &
<pharmacy name="PChek.com" country="Canada">
<drugs>
<drug name="APO-DILTIAZ CD" unit="CAPSULE"
affiliateid="https://www.interna.com/cgi-bin/ncommerce3/input?ProductName=DILTIAZ
CD&groupid=RPC" ndc="" />
</drugs>
</pharmacy>
|
|
|
|
|
I am so new to the topic of XML I am sure that I will be asking the questions wrong (I feel like the South end of a horse facing North just framing my question). I have searched for a simple examples of code and have not found any simple or direct enough to meet my ability.
I am working in Excel 2003 Pro and have a multi-sheet spreadsheet that I would like to export a fixed range of data from to an XML file (this file will be used in an Xcelsius dashboard).
The data will always be on the same sheet and of the same range, though the number of records may vary from tiem to time. I could export the data to a CSV file if this would help. I would like the export to take place on a regular schedule.
Can anyone help point me at a code example?
Many thanks in advance.
a
|
|
|
|
|
abesimpson wrote: I feel like the South end of a horse facing North just framing my question
Maybe you are. I mean when I want to learn about something new to me I don't try to do it from the perspective of my project needs. I go find a tutorial or book on the subject and read it for what it is, not try to find something in it that pertains to my current project.
For tutorials on XML I recommend TopXML and www.w3schools.com web sites. For working with Excel I recommend the MSDN documentation.
led mike
|
|
|
|
|
Hi,
I originally posted this in the ASP.NET forum, to no reply and thought I would try this forum. Apologies if I am in the wrong place.
Is it possible to auto populate a word document or word document template from ASP.NET 2.0 and also have this document emailed automatically to a user? I am able to populate a word document from a datasource using xml and xslt.
I am also able to seperately email a word document as an attachment but it is the combination of creating the word document using xslt/xml and have this automatically emailed to a user that I am having difficulty with.
I'm guessing it probably can't be done and the word document would need to be saved by the user and emailed independently.
Can anyone clarify?
Thanks.
|
|
|
|
|
|
malarpm wrote: Can any body help me on this please?
Help you with what? Read these posting guidelines[^]. Pay attention to item #11.
led mike
|
|
|
|
|
Hello All.
I have xml file which has several tables, there are several users who will be accessing this file, before i was locking the whole file so that others can just read it cannot edit. Now i want to lock only the particular table which a particular client is accessing and the rest of the tables are free to be edited .. Is this possible using C#.net ??
Thanks in advance
Ron
|
|
|
|
|
Ron.S wrote: Is this possible using C#.net ??
No, it's not possible using anything because it's just part of a file and File Systems don't provide that feature. At least none I have ever heard of.
led mike
|
|
|
|
|
No it's not possible to do this because the file system (NTFS) laks support for locking sections of files. AFAIK, there isn't a file system on this earth that supports this.
It sounds like you're treating an XML file as a small database, when in fact, you need full database support. It looks like in order to implement this requirement, you're going to have to rewrite your data access layer to use a full database, such as SQL Server Express or SQL Server Mobile.
|
|
|
|
|
I want to make a query that works like 'LIKE' in SQL
I want to retrive nodes that starts with 'X' or any starting string
Or containg 'X'
I write this XPath:
Message[Contains(@Title,'5')]
But it's wrong!!
how can I do??
plz help me
<code>
<Message MessageID="1" Title="Title1" Icon="Information" Buttons="Ok">
<Parts Part="part333333" />
<Parts Part="part333333" />
<Parts Part="part333333" />
</Message>
<Message MessageID="2" Title="Title2" Icon="Information" Buttons="Ok">
<Parts Part="part333333" />
</Message>
<Message MessageID="3" Title="Title3" Icon="Information" Buttons="Ok">
<Parts Part="part33XXXX3333" />
<Parts Part="YYpart53" />
</Message>
<Message MessageID="4" Title="Title4" Icon="Information" Buttons="Ok">
<Parts Part="YYpart53" />
</Message>
</code>
|
|
|
|
|
Masterhame wrote: how can I do??
Well you can only do what XPath supports. Also you might find that the latest XPath standards are not fully supported by many of the XPath implementations so you need to check the specific engine you are using to determine what standard it supports.
led mike
|
|
|
|
|
Hi,
I'm fairly new to using XML properly. I'm trying to write and XSD schema but I'm having trouble understanding namespaces.
Say my schema begins with...
< ?xml version="1.0"?>
< xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com"
elementFormDefault="qualified">
(without the spaces after the < signs)
and each element in the schema begins with < xs:whatever>
As I understand it, the xmlns:xs="" part identifies a source for what each of the fundamental identifiers mean, such as "element", "attribute", "simpleType", or whatever. targetNamespace="" identifies where the xsd i'm writing will be located, and xmlns="" identifies what the default namespace is (ie. if i dont put "xs:" at the beginning of things).
That's just my basic understanding that may be wrong. This is all very well, but what if the machine being used doesn't have an internet connection? How does it look up the basic types (element, attribute, etc)? Can I specify an offline source, maybe provided in Windows or the .NET framework (this is where I'm using the XML).
And once i've done this, how do I need to start an XML document that uses the schema (ie. what combination of "xmlns" things do i need to put in the root node tag?).
I realise I may have entirely missed the point of namespaces here. Any help would be greatly appreciated!
Thanks in advance!
Graeme
|
|
|
|
|
Hi all,
Assume we have 2 XML documents with the following contents:
1st
<vehicle type="car">
<doors>4</doors>
</vehicle>
2nd
<vehicle type="motorbike">
<wheels>2</wheels>
</vehicle>
Is there a way, to validate this 2 documents against a single XSD file, or I have to use seperate schemas? What I'm trying to accomplish is to determine each vehicle's elements according to vehicle's "type" attribute.
Thanks in advance,
|
|
|
|
|
Hello,
I am using a xml and xsd store data. My table will be very small no more than 10 rows.
However, I would like to start with zero records. However, I am finding I get an error with the following.
The ID element is auto incremented which is set and run time when the dataset reads the xsd schema.
My XSD:
<code>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RedialNumbers">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="RecentNumber">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:unsignedInt" />
<xs:element name="Number" type="xs:string" />
<xs:element name="Name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</code>
My XML:
<code>
<?xml version="1.0" encoding="utf-8" ?>
<RedialNumbers>
<RecentNumber>
<ID></ID>
<Number></Number>
<Name></Name>
</RecentNumber>
</RedialNumbers>
</code>
However, I get a error under the </ID> attribute. "The 'ID' element is invalid - The value '' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:unsignedInt' - The string '' is not a valid UInt32 value."
However, If I add a <ID>0</ID> I don't get the error message. However, I get 1 row already created which is what I don't want. All the rows will be created and saved at run-time.
How is it possible to start off with a blank rows?
Many thanks for any suggestions,
Steve
|
|
|
|
|
i have loaded xml+xsl in html. but it only works for simple xml and xsl.when i have a large xml and slightly cmplex xsl and have dtd the code dosen't work.
here is the code for loading::
<title>
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}
function displayResult()
{
///////////////LOAD XML & XSL/////////////////
xml=loadXMLDoc("Book2006_Overview.xml");
xsl=loadXMLDoc("book2006.xsl");
// code for IE
if (window.ActiveXObject)
{
ex=xml.transformNode(xsl);
document.getElementById("example").innerHTML=ex;
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xsltProcessor=new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("example").appendChild(resultDocument);
}
}
can anyone send me the code works for all xml and xsl pls?
|
|
|
|
|
Member 4660724 wrote: the code dosen't work.
And you think we know what that means? Good luck
led mike
|
|
|
|
|
Do the xml namespaces in the more complex xml and those in the more complex xslt match? This often happens when moving from a test document to a real live one.
We can't see the problem unless you want to put up an example of the simple xml/xslt and then the more complex failing ones.
|
|
|
|
|
Hi,
the problem of loading xml+xsl is solved for mozilla.the problem was i ddin't know mozilla doesn't support external dtd.it works fine for internal dtd.But IE cannot load either external or internal.i used several alerts in several position.all are showed in output.but the transformed xml page does not show.
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
alert("LoadXML");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}
function displayResult()
{
xml=loadXMLDoc("Book2006_Overview.xml");
xsl=loadXMLDoc("Book2006_manee.xsl");
// code for IE
if (window.ActiveXObject)
{
ex=xml.transformNode(xsl);
document.getElementById("example").innerHTML=ex;
alert("after innerHTML");
alert(ex);
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xsltProcessor=new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("example").appendChild(resultDocument);
}
}
|
|
|
|
|
Hello together,
i wondered if there's a simple possibility to combine several xml schemata in one single file?
The schemas are connected using include-statements.
It would be nice instead of deploying several files at once to deploy just one.
I'm using Altova XML Spy 2008 for creating the schemas.
Thanks for any help!!
happy programming...
|
|
|
|
|
I’m a novice in XSD and not know some. I use MS Visual Studio 2005 to generate XML schema by dragging table from Server Explorer. Some column properties are not generated in xsd file. I want to add them but not know how to add them or whether they should be added or not. Pls help me.
1. I don’t know how to identify these column properties based on Microsoft SQL Server, in XML schema?
eg,
In SQL,
Create Table Employee(
EmpID int identity Not Null,
Constraint PK_Employee Primary Key (EmpID)
)
In XSD,
<xs:element name="“Employee”">
<xs:complex type="">
<xs:sequence>
<xs:element name="“EmpID”" type="“xs:int”/">
br mode="hold" />
2. In Sql, we can define variable length. But in xsd, there is no limit length. Is it all right?
Eg,
In sql,
EmpName varchar(20) Not Null
In xsd,
<xs:element name="”EmpName”" type="“xs:string”/">
3. How I can describe Derived attribute in XSD? Can I use DefaultValue?
Eg,
In sql,
Create Table Furniture(
FurnitureID smallint,
LowSize int,
HighSize int,
AvgSize As (LowSize + HighSize)/2
)
In xsd,
<xs:element name="“FurnitureID”" type="“xs:short”/">
<xs:element name="“LowSize”" type="“xs:int”/">
<xs:element name="“HighSize”" type="“xs:int”/">
<xs:element name="“AvgSize”" type="“xs:int”" msdata:defaultvalue="“(LowSize+HighSize)/2”/">
4. And also Default Constraint like below?
Eg,
State varchar(10) constraint DF_State Default ‘YK’
<xs:element name="“State”" type="”xs:string”" default="“YK”/">
Good Luck!
soclose
(oops xsd keyword are missed! why? )
modified on Monday, March 17, 2008 9:19 AM
|
|
|
|
|
Hi,
I'm wondering if anybody could help me with the following?
I have this XML:
<?xml version="1.0" encoding="utf-8"?>
<dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
xmlns="http://developer.cognos.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
<metadata>
<item name="Product type" type="xs:string" length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
<data>
<row>
<value>Binoculars</value>
<value>1075087</value>
</row>
<row>
<value>Climbing Accessories</value>
<value>5850251</value>
</row>
<row>
<value>Cooking Gear</value>
<value>13400351</value>
</row>
</data>
</dataset>
which I want to transform to the following using XSL (the number of row nodes is not fixed):
<?xml version="1.0" encoding="utf-8"?>
<data>
<row
ProductType="Binoculars"
Quantity="1075087"
/>
<row
ProductType="Climbing Accessories"
Quantity="5850251"
/>
<row
ProductType="Cooking Gear"
Quantity="13400351"
/>
</data>
Please notice that the metadata node (in the source XML) contains the names to be used in the resulting XML file as attribute names and that the name can contain one or more spaces (as indicated below in the name "Product yype").
<metadata>
<item name="Product type" type="xs:string" length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
Thank you very much in advance...
|
|
|
|