|
Hi again thanks for your help with adding the XML data
i need to ask you another question
i've got my final xml file looking exactly as i need it to be
<?xml version="1.0" encoding="utf-8"?>
<chores>
<day label="111" title="asdasd">
<job a="2" b="22" c="22" d="22" />
<job a="2" b="22" c="22" d="22" />
</day>
</chores>
im trying to Edit this file in a dataGrid but its not working
my aspx page
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EditTables.aspx.cs" Inherits="EditTables" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table class="style1">
<tr>
<td>
<br />
<br />
Edit your Products tables<br />
</td>
</tr>
<tr>
<td>
<asp:DataGrid ID="DataGrid1" runat="server" AllowPaging="True"
AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"
oncancelcommand="DataGrid1_CancelCommand"
ondeletecommand="DataGrid1_DeleteCommand" oneditcommand="DataGrid1_EditCommand"
onpageindexchanged="DataGrid1_PageIndexChanged"
onupdatecommand="DataGrid1_UpdateCommand" AutoGenerateColumns="False"
Width="890px">
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:TemplateColumn HeaderText=" label">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "label")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxTitle"
Text='<%# DataBinder.Eval(Container.DataItem, "label") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="title">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "title")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxTitle"
Text='<%# DataBinder.Eval(Container.DataItem, "title") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="כמות">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "a")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxAmount"
Text='<%# DataBinder.Eval(Container.DataItem, "a") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="מחירון">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "b")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxPrice"
Text='<%# DataBinder.Eval(Container.DataItem, "b") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="גודל">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "c")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxSize"
Text='<%# DataBinder.Eval(Container.DataItem, "c") %>'
runat="server" Height="22px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="מוצר">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "d")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxProduct"
Text='<%# DataBinder.Eval(Container.DataItem, "d") %>'
runat="server" Height="22px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit" UpdateText="Update">
</asp:EditCommandColumn>
<asp:ButtonColumn CommandName="Delete" Text="Delete"></asp:ButtonColumn>
</Columns>
<EditItemStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#F7F6F3" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:DataGrid>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblerror" runat="server" ForeColor="Maroon"></asp:Label>
</td>
</tr>
</table>
</asp:Content>
and this is my CS code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Globalization;
using System.IO;
using System.Data;
using System.Data.OleDb;
public partial class EditTables : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!User.IsInRole("Admin"))
Server.Transfer("login.aspx");
if (!(Page.IsPostBack))
{
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
}
protected DataSet LoadMyData()
{
string sourceXml = Server.MapPath("~/xml/chores2.xml");
if (!(File.Exists(sourceXml)))
{
return null;
}
DataSet cachedDataSet = (DataSet)Session["table"];
if (!(cachedDataSet == null))
{
return cachedDataSet;
}
DataSet dataSet = new DataSet();
try
{
dataSet.ReadXml(sourceXml);
Session["table"] = dataSet;
}
catch (Exception e)
{
lblerror.Text = e.Message;
dataSet = null;
}
return dataSet;
}
protected void DataGrid1_EditCommand(object source, DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex);
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
protected void DataGrid1_CancelCommand(object source, DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = -1;
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
protected void DataGrid1_DeleteCommand(object source, DataGridCommandEventArgs e)
{
DataSet dataSet = LoadMyData();
int row = Convert.ToInt32(e.Item.ItemIndex);
dataSet.Tables[0].Rows[row].Delete();
dataSet.WriteXml(Server.MapPath("~/XML/chores2.xml"));
Session["table"] = null;
DataGrid1.EditItemIndex = -1;
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
protected void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e)
{
DataSet dataSet = LoadMyData();
int row = Convert.ToInt32(e.Item.ItemIndex);
TextBox txtBoxLabel = (TextBox)e.Item.FindControl("txtBoxLabel");
dataSet.Tables[0].Rows[row]["label"] = txtBoxLabel.Text;
TextBox txtBoxTitle = (TextBox)e.Item.FindControl("txtBoxTitle");
dataSet.Tables[0].Rows[row]["title"] = txtBoxTitle.Text;
TextBox txtBoxProduct = (TextBox)e.Item.FindControl("txtBoxProduct");
dataSet.Tables[0].Rows[row]["a"] = txtBoxProduct.Text;
TextBox txtBoxSize = (TextBox)e.Item.FindControl("txtBoxSize");
dataSet.Tables[0].Rows[row]["b"] = txtBoxSize.Text;
TextBox txtBoxPrice = (TextBox)e.Item.FindControl("txtBoxPrice");
dataSet.Tables[0].Rows[row]["c"] = txtBoxPrice.Text;
TextBox txtBoxAmount = (TextBox)e.Item.FindControl("txtBoxAmount");
dataSet.Tables[0].Rows[row]["d"] = txtBoxAmount.Text;
dataSet.WriteXml(Server.MapPath("~/XML/chores2.xml"));
Session["table"] = null;
DataGrid1.EditItemIndex = -1;
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
DataGrid1.DataSource = LoadMyData();
DataGrid1.DataBind();
}
}
it keeps telling me whenever i load the page
DataBinding: 'System.Data.DataRowView' does not contain a property with the name a..
anyway the problem is here..
dataSet.Tables[0].Rows[row]["a"] = txtBoxProduct.Text;
i guess this line is not working for the xml attributes
int row = Convert.ToInt32(e.Item.ItemIndex);
how can i fix that to work with my xml?
|
|
|
|
|
Actually, your DataSet contains two Table s : day and job, I guess that's where the problems start.
I'm not very familiar with databinding, I would ask in another forum (as this whole question probably should have been ).
The problem is not the attributes, the "title" and "label" attributes are acceptable to the binder. Also the other attributes ARE present as columns in table "job".
So, post this question in the ASP or Web Development corner of CP.
Cheers
|
|
|
|
|
Hi
i created a dropdownlist that shows all the ((day- label attribute)). by selecting one of those item, it will bind all that selected node's data in a datagrid.
In other words, how can i bind the selected node from the dropdownlist to a datagrid that will bind its attributes?
|
|
|
|
|
Hi all
I want to save my images in XML file and read my XML file and export images from it and show in the .aspx page.
How can i save my images in XML file and how can i export these images and show them in .aspx page?
|
|
|
|
|
Well if you would save the url of the images
in an xml file ...
<?xml version="1.0" encoding="utf-8" ?>
<root>
<img src="Myjpeg1.jpg" />
<img src="Myjpeg2.jpg" />
</root>
You could then add a repeater to aspx
page and set it's data source to the
xml file and then make the itemtemplate like this ...
<ItemTemplate>
<img src='<%# DataBinder.Eval(Container.DataItem, "src") %>'/>
</ItemTemplate>
|
|
|
|
|
XML FILE.....
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml-stylesheet type="text/css" href="catalog.css"?>
<!DOCTYPE shop SYSTEM "cataloge.dtd">
<!-- . -->
<!-- Avnish Dusara -->
<!-- 12-02-2010 -->
<shop>
<detail>
<shopName>Pc World/Currys</shopName>
<street>Lower High Street</street>
<city>Watford</city>
<postCode>WD25 7DU</postCode>
<telNumber>01923 640 9684</telNumber>
<email>pc.currys@dsg.com</email>
<url>www.pc/currysonline.com</url>
</detail>
<catalog>
<computers>
<computer:packardbell xmlns:computer="http://www.google.ca/">
<computer:itemID>654132</computer:itemID>
<computer:itemName>PACKARD BELL</computer:itemName>
<computer:desc>ALL IN ONE TOUCH SCREEN</computer:desc>
<computer:OS>VISTA</computer:OS>
<computer:cpu>AMD</computer:cpu>
<computer:speed>2.6</computer:speed>
<computer:memory>1GB</computer:memory>
<computer:hdd>250GB</hdd>
<computer:wirelessEnabled>NO</computer:wirelessEnabled>
<computer:quantity>3</computer:quantity>
<computer:price>435.62</computer:price>
</computer:packardbell>
<computer:sony xmlns:computer="http://www.google.ca/">
<computer:itemID>654328</computer:itemID>
<computer:itemName>SONY</computer:itemName>
<computer:desc>UNLTRA SLIM DESKTOP</computer:desc>
<computer:OS>WINDOWS 7</computer:OS>
<computer:cpu>i5</computer:cpu>
<computer:speed>2.1</computer:speed>
<computer:memory>2GB</computer:memory>
<computer:hdd>300GB</computer:hdd>
<computer:wirelessEnabled>YES</computer:wirelessEnabled>
<computer:quantity>8</computer:quantity>
<computer:price>654.65</computer:price>
</computer:sony>
<computer:toshiba xmlns:computer="http://www.google.ca/">
<computer:itemID>123456</computer:itemID>
<computer:itemName>TOSHIBA</computer:itemName>
<computer:desc>POWER AND PERFORMANCE</computer:desc>
<computer:OS>XP</computer:OS>
<computer:cpu>i3</computer:cpu>
<computer:speed>1.3</computer:speed>
<computer:memory>3GB</computer:memory>
<computer:hdd>500GB</computer:hdd>
<computer:wirelessEnabled>NO</computer:wirelessEnabled>
<computer:quantity>12</computer:quantity>
<computer:price>123.32</computer:price>
</computer:toshiba>
<computer:HP xmlns:computer="http://www.google.ca/">>
<computer:itemID>654987</computer:itemID>
<computer:itemName>HP</computer:itemName>
<computer:desc>HOME MOBILE USE</computer:desc>
<computer:OS>WINDOWS 98</computer:OS>
<computer:cpu>i7</computer:cpu>
<computer:speed>1.1</computer:speed>
<computermemory>4GB</computer:memory>
<compute:rhdd>1TB</computer:hdd>
<computer:wirelessEnabled>YES</computer:wirelessEnabled>
<computer:quantity>20</computer:quantity>
<computer:price>789.65</computer:price>
</computer:HP>
</computers>
<homeappliances>
<washingMachine:Bosch xmlns:washingMachine="http://www.google.ca/">>
<washingMachine:itemNumber>986336</washingMachine:itemNumber>
<washingMachine:itemName>Bosch</washingMachine:itemName>
<washingMachine:desc>Fast Cycle</washingMachine:desc>
<washingMachine:color>Pink</washingMachine:color>
<washingMachine:quantity>3</washingMachine:quantity>
<washingMachine:price>236.10</washingMachine:price>
</washingMachine>
<washingMachine:Hot_Point xmlns:washingMachine="http://www.google.ca/">>
<washingMachine:itemNumber>741741</washingMachine:itemNumber>
<washingMachine:itemName>Hot Point</washingMachine:itemName>
<washingMachine:desc>Auto Rinse</washingMachine:desc>
<washingMachine:color>Rainbow</washingMachine:color>
<washingMachine:quantity>6</washingMachine:quantity>
<washingMachine:price>321.65</washingMachine:price>
</washingMachine>
<television:Panasonic xmlns:televison="http://www.google.ca/">>
<television:itemNumber>852852</television:itemNumber>
<television:itemName>Panasonic</television:itemName>
<television:desc>Plasma</television:desc>
<television:size>32'</television:size>
<television:quantity>4</television:quantity>
<television:price>469.45</television:price>
</television:Panasonic>
<television:lg xmlns:televison="http://www.google.ca/">>
<television:itemNumber>963852</television:itemNumber>
<television:itemName>LG</television:itemName>
<television:desc>LED</television:desc>
<television:size>42'</television:size>
<television:quantity>9</television:quantity>
<television:price>987.65</television:price>
</television:lg>
<vacuumeCleaner:Dyson xmlns:vacuumeCleaner="http://www.google.ca/">>
<vacuumeCleaner:itemNumber>963741</vacuumeCleaner:itemNumber>
<vacuumeCleaner:itemName>Dyson</vacuumeCleaner:itemName>
<vacuumeCleaner:desc>Cyclone Function</vacuumeCleaner:desc>
<vacuumeCleaner:bagRefrence>No</vacuumeCleaner:bagRefrence>
<vacuumeCleaner:quantity>2</vacuumeCleaner:quantity>
<vacuumeCleaner:price>65.48</vacuumeCleaner:price>
</vacuumeCleaner:Dyson>
<vacuumeCleaner:Henry xmlns:vacuumeCleaner="http://www.google.ca/">>
<vacuumeCleaner:itemNumber>852741</vacuumeCleaner:itemNumber>
<vacuumeCleaner:itemName>Henry</vacuumeCleaner:itemName>
<vacuumeCleaner:desc>Old Fashion</vacuumeCleaner:desc>
<vacuumeCleaner:bagRefrence>Yes</vacuumeCleaner:bagRefrence>
<vacuumeCleaner:quantity>5</vacuumeCleaner:quantity>
<vacuumeCleaner:price>67.32</vacuumeCleaner:price>
</vacuumeCleaner>
<microwave:Cannon xmlns:microwave= "http://www.google.ca/">>
<microwave:itemNumber>741159</microwave:itemNumber>
<microwave:itemName>Cannon</microwave:itemName>
<microwave:desc>Electrical and Simple</microwave:desc>
<microwave:quantity>8</microwave:quantity>
<microwave:price>50.99</microwave:price>
</microwave:Cannon>
<microwave:Kenwood xmlns:microwave= "http://www.google.ca/">>>
<microwave:itemNumber>986256</microwave:itemNumber>
<microwave:itemName>Kenwood</microwave:itemName>
<microwave:desc>Gas and Complex</microwave:desc>
<microwave:quantity>4</microwave:quantity>
<microwave:price>197.99</microwave:price>
</microwave:Kenwood>
</homeappliances>
</catalog>
</shop>
DTD CODE.....
<!--
New Perspectives on XML
Tutorial 3
Case Problem 1
PBA team roster DTD
Author: Avnish Dusara
Date: 26 Feb 2010
Filename: teams.dtd
Supporting Files:
-->
<!ELEMENT shop (detail*, catalog*)>
<!ELEMENT detail (myLogo, shopName, street, city, postCode, telNumber, email, url)>
<!ELEMENT shopName (#PCDATA)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT postcode (#PCDATA)>
<!ELEMENT telnumber (#PCDATA)>
<!ELEMENT e-mail (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ELEMENT catalog (computers, homeappliances)>
<!ELEMENT computers (computer+)>
<!ELEMENT computer (itemID, itemName, desc, os, cpu, speed, memory, hdd, wirelessEnabled, quantity, price)>
<!ATTLIST computer type CDATA #REQUIRED>
<!ELEMENT itemID (#PCDATA)>
<!ELEMENT itemName (#PCDATA)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT os (#PCDATA)>
<!ELEMENT cpu (#PCDATA)>
<!ELEMENT speed (#PCDATA)>
<!ELEMENT memory (#PCDATA)>
<!ELEMENT hdd (#PCDATA)>
<!ELEMENT wirelessEnabled (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT homeappliances (washingMachine*, television*, vacuumeCleaner*, microwave*)>
<!ELEMENT washingMachine (itemNumber, itemName, desc, color, quantity, price)>
<!ELEMENT itemNumber (#PCDATA)>
<!ELEMENT itemName (#PCDATA)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT color (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT television (itemNumber, itemName, desc, size, quantity, price)>
<!ELEMENT itemNumber (#PCDATA)>
<!ELEMENT itemName (#PCDATA)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT size (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT vacuumCleaner (itemNumber, itemName, desc, bagReference, quantity, price)>
<!ELEMENT itemNumber (#PCDATA)>
<!ELEMENT itemName (#PCDATA)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT bagReference (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT microwave (itemNumber, itemName, desc, color, quantity, price)>
<!ELEMENT itemNumber (#PCDATA)>
<!ELEMENT itemName (#PCDATA)>
<!ELEMENT desc (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT price (#PCDATA)>
Basically the top xml is a inventory for a company named tiger direct which im sure you have all heard of and the dtd is a link to that xml. Please ignore small things like google.ca as the url indicator for the namespacing. but they dont link because the dtd is done wrong. can someone please tell me where i went wrong?
Cheers !
|
|
|
|
|
Oh dear….where should we start…
Firstly - the namespacing…that's not going to help, because DTDs don't understand namespaces at all.
Second, that XML cannot be valid - you have tags names things like 'packardbell' and 'sony' - they aren't tag names, they should be part of the data…
Anyway - here's (I think) what the first computer element should look like:
<computer type="you need to put something here... - desktop?">
<itemID>654132</itemID>
<itemName>PACKARD BELL</itemName>
<desc>ALL IN ONE TOUCH SCREEN</desc>
<OS>VISTA</OS>
<cpu>AMD</cpu>
<speed>2.6</speed>
<memory>1GB</memory>
<hdd>250GB</hdd>
<wirelessEnabled>NO</wirelessEnabled>
<quantity>3</quantity>
<price>435.62</price>
</computer>
You'll note that the element is now correctly named 'computer' and namespacing has been removed. Similar changes need to be made to all the computer and home appliance elements.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
hey thanks so much for your reply and time to help me out.
I actually did it liek this before.....
<computer type="desktop">
<itemID>654132</itemID>
<itemName>PACKARD BELL</itemName>
<desc>ALL IN ONE TOUCH SCREEN</desc>
<OS>VISTA</OS>
<cpu>AMD</cpu>
<speed>2.6</speed>
<memory>1GB</memory>
<hdd>250GB</hdd>
<wirelessEnabled>NO</wirelessEnabled>
<quantity>3</quantity>
<price>435.62</price>
</computer>
my XML is working just fine its the .dtd that doesn't complie as it should.
|
|
|
|
|
by the way so if i have name spacing, i dont include those elements in the DTD?
|
|
|
|
|
Ummm - you have lots of issues with the DTD as well. You've got lots of repeated elements (itemName and itemNumber, for example). The element names in the definition of the content of the detail element don't match the element naems defined in the DTD (postCode vs postcode, for example).
And remember, the XML is NOT fine if it doesn't validate against the DTD...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi,
I have a xml file that define the path and image to a Video Player .You can see it on www.gogurugo.com/SiteInfo.aspx?id=Ap
Click on any thumbnail and it goes to www.gogurugo.com/Video.aspx
but when we select next time another thumbnail it does not update xml file with current Video.
Everybody please see the site,all of you will understand my problem,Use Internet Explorer and also use Mozila FireFox.
You will see the problem.
Please help me how can i solve this issue?
Thanks
VD
|
|
|
|
|
Now I Know how work XML and XSLT, and if the output is HTML I hav´nt any problem, but I want to generate a new XML file starting from other XML file with the modifications stablished in a XSLT stylesheet, and my question is:
Which is the central object in Visual Studio 2005 whis is able of charging the original XML file apply the transformations contained in the XSLT file and save the result in the new XML File.
Best Regards
|
|
|
|
|
I've just found by myself, the object is an instance of the class XslCompiledTransform whicn enables all the process.
regards
|
|
|
|
|
First the issue. I have an Open Source application that uses a database which is contains copyrighted information. This database is an XML database which is obviously a bunch of folders and files under a single folder called RM-XML. I cannot distribute this database to the public, I can only distribute a template which I think makes running this program rather frustrating to users. That is in order to run it they have to create a database. Something that took me weeks to make.
Idea: I would like to somehow compile or encrypt this database folder so that it's unreadable to the end-user akin to either a serialized document or something that has been compiled along with the application so that the .exe itself also holds the XML somewhere in its code. Then I can reference this database in my code. The application uses wxWidgets for the front-end and C++ for the back-end.
I have no idea where to begin other than here to see if anyone has any ideas of how to make this possible, if it really is possible. Maybe I have to export the database to something else and compile it. Hopefully this is enough to allow me to distribute this database with the application.
Thanks!
|
|
|
|
|
You could try zipping the folder with a password, then use the zip file as a file-system from within your program? That's what (for example) Microsoft do with Office 2007 files - a .docx file is just an XML file and folder structure in a zip file...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
hi
I been trying to get an XML from another server. the problem is , i got a form with POST and the form action send me to another page out of my server so i cant read the XML,
i have to do this because i got a service called "dineromail" , i only send a var to the url Action and it returns me an XML but i dont know how read it.
im using PHP or ASP .
The biggest question is how can i read the answer of my form action?
<form name=\"f1\" method=\"GET\" action=\"https://mexico.dineromail.com/vender/Consulta_IPN.asp\" enctype=\"application/x-www-form-urlencoded\" \">
thanks
|
|
|
|
|
This is really more of a Web Development question
but the best answer is to use PHP or ASP to get
the file on your server then make it accessable
to the client.This applies to any file from a
different domain not just xml.
|
|
|
|
|
I go with foreach through all childs of one element and select them. Now when i put every selected child in table, they are written together. How could i seperate them with space or with comma?
|
|
|
|
|
Maybe with <xsl:text> ? That's what I use to produce CSV.
|
|
|
|
|
thats what i was searching for.thx
|
|
|
|
|
Hello,
for a business application in C# I have a more complex object representing an article. Attached to this object there are numerous further objects representing the suppliers, prices, storage locations and quite a few things more. These objects in turn may have further objects or collections with further information. In the end the whole structure represents everything we have in the database concerning this article. Please note, this is not a DataSet. It's a complex data object loaded from the database with NHibernate.
Now we would like to serialize selected articles to XML. We have prepared a XML schema, but now it's the question how we proceed with serializing. I could simply use a XmlWriter class and provide each data object with a method to serialize itself and recursively all attached objects and collections, but I hope there is a better way.
Is there a way to associate the schema with the data objects and their properties and then serialize the data objects with the bonus of not having to write serialization methods for each and every data object and also validation against the schema?
Edit: I took a closer look at the System.Xml.Serialisation namespace, but unfortunately this will not help in this case. The problem is that I would have to decorate a collection of articles with the XmlRoot attribute. Due to the number of articles to be serialized I cannot simply fill some kind of collection and then serialize everything. It must be done one article at a time.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.
I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
modified on Tuesday, March 23, 2010 5:58 AM
|
|
|
|
|
I wanna know how to build one element out of three childs so in xml view in browser i could see with value and also i could expand it and see value of childs..for example date..
<!date>12.10.2010<!/date>
should be build out of
<!date>
<!d>12<!/d>
<!m>10<!/m>
<!y>2010<!/y>
<!/date>
How do i do this? I am using xmlspy for building xmls..
Thanks for any help
|
|
|
|
|
This code:
xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}
}
return
element results {
for $a in $doc/node()
return
$a/node()
}
returns (as expected)
<results>abcdef</results>
If I change the last line to $fn:replace($a/node(), 'x', 'y') , i.e.,
xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}
}
return
element results {
for $a in $doc/node()
return
fn:replace($a/node(), 'x', 'y')
}
The results contain a space between the 'c' and 'd':
<results>abc def</results>
Does anyone have a clue as to where this is coming from? Note that the replace is looking for a character that's not there, so the search string should not be changed.
Thanks.
|
|
|
|
|
i hav made an xml file..as well as an xsd file..i need to refer this xsd file in the xml file..
what should i include in the <xs:schema> tag of the xsd file..?? and what to include in the <root> tag of the xml file..
these r my xsd and xml files respectively..
<code><?xml version="1.0"?>
<xs:schema>
<xs:element name="details">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string">
<xs:element name="age" type="xs:string">
<xs:sequence>
<xs:complexType>
<xs:element>
<xs:schema>
<?xml version="1.0"?>
<details>
<name>abc</name>
<age>22</age>
<details></code>
i am new to xml..i require your help..
thanks a lot in advance..
|
|
|
|
|
Hi,
you have to change the root of your schema file to
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mynamespace/mydetails">
This will define the xs prefix and the namespace you want to create.
Within your xml file you have to put a reference to the schema by changing the root to this:
<details xmlns="http://mynamespace/mydetails">
Here the namespace is imported without a prefix. But pay attention if you need to validate the xml (if it is valid according to the schema). The reference will be resolved by a DefaultResolver. This one will not find the schema file until you give it a hint.
Simple code to validate an XML file against a schema file (XSD)[^]
Regards
Sebastian
|
|
|
|
|