|
Hello there
I am working on a 3D project, and I have xml files here but I want to transform them so they can be used. Does anyone know any good software for this
Thanks
Andrew McIntyre
|
|
|
|
|
Welcome to CodeProject
Take the time to read this handy forum guidelines article[^]
MrMcIntyre wrote: I have xml files here but I want to transform them so they can be used. Does anyone know any good software for this
Well, we are mostly software developers here, not clairvoyants.
You have what in XML files?
You want to transform into what?
So they can be used for what?
led mike
|
|
|
|
|
Well the XML files contain programming which will make the menus like for login or character creation ect.
Andrew McIntyre
|
|
|
|
|
I think you might be missing a concept here at codeproject. You are asking people to help for free. The least you can do is put in sufficient effort to communicate your situation and needs. What you have posted in this thread is not near that level of effort.
led mike
|
|
|
|
|
How can I put effort in if I want help on the subject.
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: How can I put effort in if I want help on the subject.
What is your damage dude?
led mike wrote: The least you can do is put in sufficient effort to communicate your situation and needs.
led mike
|
|
|
|
|
Can you emphasize for "your damage" what do you mean by this?
Andrew McIntyre
|
|
|
|
|
You are being too general with your request for help. There are all kinds of products that can transform any type of XML file. However, all projects have requirements and constraints which you failed to mention in regards to your XML files. Furthermore, XML can be tranformed into many different documents. So, what is your motivation?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I am making a virtual world virtual world require xml files for the menus and with lua files supporting the xml files.
Andy
|
|
|
|
|
Unfortunately, I don't know anything about this. Do you have any links or examples of what you need to do?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
AndrewMcIntyre wrote: I am making a virtual world virtual world require xml files for the menus and with lua files supporting the xml files.
Having read a number of your questions it would appear that you believe you can conjure this virtual world from the ether with little or no effort on your part. I advised you some time ago that you need to spend a lot of time studying the basics before you can even begin to think about creating this grandiose project. Your first attempt at a simple Windows program here[^] demonstrated that you still have a long way to go.
Sorry to burst your balloon on this but none of the people answering questions, and writing articles here, got to where they now are without a lot of studying, hard work and dedication.
|
|
|
|
|
Hi! Expert
I am not so good in Macros. I have write a macro a few month before for a excel file. Now i receive same type of file but more Columns and rows.
Attached file:http://www.savefile.com/files/1788469
but unfortunately it will not work on this worksheets.there is 2 sheet in this file (Master and iwant this)
i want to transpose some cells into Rows.
i have a data about 9000
In Below mentioned Example: You see there is one Custcode Repeated 4 times with 1 Network and Prop Name but Four Childname and their ChildDOB in the Column
CustCode
networkname
PropName
ChildrenName
Child DOB
221000000133
Jind Cable Network
Ravinder Kumar
Swati
8-Mar-91
221000000133
Jind Cable Network
Ravinder Kumar
Meenakshi
9-Apr-95
221000000133
Jind Cable Network
Ravinder Kumar
Shubham
16-Dec-96
221000000133
Jind Cable Network
Ravinder Kumar
Atul
17-Jul-98
What I want (NOTE THIS IS NOT A COMPLETE HEADERS DATA I HAD HIDE SOME COLUMNS BECAUSE FOR BETTER CLARIFICATION)
Now, you can seen the difference between these two data specially the Childname and ChildDOB in 1st they both in columns but in 2nd one they both are in Row.
CustCode
networkname
PropName
ChildrenName
Child DOB
ChildrenName
Child DOB
ChildrenName
Child DOB
ChildrenName
Child DOB
221000000133
Jind Cable Network
Ravinder Kumar
Swati
8-Mar-91
Meenakshi
9-Apr-95
Shubham
16-Dec-96
Atul
17-Jul-98
Now take a 2nd example:
You see there is one Custcode Repeated 5 times with 1 Network But 2 Prop Name first one i.e Arjun Sharma have 3 Childname and with their ChildDOB ,But the second one i.e have 2 Childname and with their ChildDob. inColumns.
221000000232
City Communication
Arjun Sharma
Rajiv Sharma
10-Jul-79
221000000232
City Communication
Arjun Sharma
Suveta Sharma
13-Jan-81
221000000232
City Communication
Arjun Sharma
Seema Shurma
29-Oct-85
221000000232
City Communication
Parshotam Lal Bhalla
Kuldeep Bhalla
7-Sep-03
221000000232
City Communication
Parshotam Lal Bhalla
Isha Bhalla
24-Apr-05
What I want:
221000000232
City Communication
Arjun Sharma
Rajiv Sharma
10-Jul-79
Suveta Sharma
13-Jan-81
Seema Shurma
29-Oct-85
221000000232
City Communication
Parshotam Lal Bhalla
Kuldeep Bhalla
7-Sep-03
Isha Bhalla
24-Apr-05
You can see Difference Cleary. Specially Childname and ChildDOB.
Any Help will be Appreciate
Hardeep kanwar
|
|
|
|
|
Sorry For not mentioned the Macors
Sub sameoldcalvin()
'
' Macro3 Macro
'
Dim i As Long
Dim SearchRange As Range
Dim FindRow As Range
Dim pp As String
Range("G1").Select
Start:
Do
' Whole process loop counter = do it 9000 times
i = i + 1
ActiveCell.Offset(1, 0).Range("A1").Select
pp = ActiveCell.Value
Set SearchRange = Range("G:G")
Set FindRow = SearchRange.Find(pp, LookIn:=xlValues, lookat:=xlWhole)
If FindRow.Row = ActiveCell.Row Then
GoTo Start
Else
Selection.End(xlToLeft).Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, 4).Range("A1:B1").Select
Selection.Cut
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -2).Range("A1").Select
'delete
ActiveCell.Rows("1:1").EntireRow.Select
ActiveCell.Activate
Selection.Delete Shift:=xlUp
ActiveCell.Offset(-1, 3).Range("A1").Select
End If
Loop Until i = 9000
End Sub
|
|
|
|
|
Hi,
My XML looks like <book>ABC,XYZ
In my coding I getting this using
XmlNodeList allNodes= XmlDoc.GetElementsByTagName("Book");
I am checking whether this any childnodes exists for this using
XmlNode child=allNodes[0].ChildNodes[0];
string Childname= child.Name;
I am getting this(childname as) "#text" ,though no childnode is there in my XML
|
|
|
|
|
Both your allNodes object and the ChildNodes property of allNodes is a XMLNodeList. Thus, both allNodes and ChildNodes have a Count property that you can check to verify if GetElementByTagName returned any nodes or if ChildNodes contains any nodes.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi all,
I am trying to save a list of products in a XML database. But, when I try to read the xml file (outputting goes ok, using the XMLTextWriter) I get an error message telling me that there are illegal characters in a name and that the document can't be read. What can I do about this? I am trying to save the products as follows: (I am using Visual Basic.NET - VS2005)
<code>
[Groupname]
[Brandname]
[Productname]
[Price]3,99[/Price]
[ItemID]12345[/ItemID]
[Description]""[/Description]
[/Productname]
[/Brandname]
[/Groupname]
</code>
And it is no option to not let people type special characters, since there are loads of brand- and productnames containing special characters (like é, ä, @ etc)
Please help me out,
--Zaegra--
Motivation is the key to software development.
modified on Thursday, September 11, 2008 12:50 PM
|
|
|
|
|
|
Hi All,
I have this XML document:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="WriteXMLToDBTest_SQLScript.xsl"?>
<OrderDetails>
<Order ID="10248">
<OrderItem ProductID="11">
<QuantityIncrease>2</QuantityIncrease>
</OrderItem>
</Order>
<NewOrder ID ="10249">
<OrderItem ProductID ="12">
<QuantityIncrease>3</QuantityIncrease>
</OrderItem>
</NewOrder>
</OrderDetails>
and have applied this XSL:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method ="text" encoding ="utf-8"/>
<xsl:output indent ="yes"/>
<xsl:template match ="/">
<xsl:apply-templates select ="OrderDetails/Order"/>
<xsl:apply-templates select ="OrderDetails/NewOrder"/>
</xsl:template>
<xsl:template match ="Order">
<xsl:text>Update [Order Details] Set Quantity = Quantity + </xsl:text>
<xsl:value-of select ="OrderItem/QuantityIncrease"/>
<xsl:text> Where OrderID = </xsl:text>
<xsl:value-of select ="@ID"/>
<xsl:text> And ProductID = </xsl:text>
<xsl:value-of select ="OrderItem/@ProductID"/>
</xsl:template>
<xsl:template match ="NewOrder">
<xsl:text>Update [Order Details] Set Quantity = Quantity + </xsl:text>
<xsl:value-of select ="OrderItem/QuantityIncrease"/>
<xsl:text> Where OrderID = </xsl:text>
<xsl:value-of select ="@ID"/>
<xsl:text> And ProductID = </xsl:text>
<xsl:value-of select ="OrderItem/@ProductID"/>
</xsl:template>
</xsl:stylesheet>
and it generates two sql statements:
Update [Order Details] Set Quantity = Quantity + 2 Where OrderID = 10248 And ProductID = 11Update [Order Details] Set Quantity = Quantity + 3 Where OrderID = 10249 And ProductID = 12
problems in here is that two "update statements" on the single line and i would like to know how to seperate them like this:
Update [Order Details] Set Quantity = Quantity + 2 Where OrderID = 10248 And ProductID = 11
Update [Order Details] Set Quantity = Quantity + 3 Where OrderID = 10249 And ProductID = 12
Thanks a lot
|
|
|
|
|
Do you realize that depending on the source of the XML you could be exposing your system to SQL Injection[^] attacks due to your antiquated technique of updating a database? Antiquated in this case means generating SQL statements.
led mike
|
|
|
|
|
ok, cool, i just realise this, thanks to mention that to me.
|
|
|
|
|
Hello,
I am trying to read the attached XML file by entering the <string code="????"> and return the value for <lang code="EN">Access Allowed List</lang>.
I have worked with reading simple XML elements but have not worked with atributes and the like. I am also new to both XML and Dev in general.
I have read several articles but most give me examples for reading simple XML e.g.
<person>
<firstname>John</firstname>
<lastname>Smith</lastname>
</person>
The file I am trying to read is below, any help would be great and examples are very much welcome. My goal for the GUI in VB.NET will be to have a textbox to enter string number I am searching for and a dropdown but to select the language.
Regards
Jason
<momlang>
<string code="2000">
<lang code="AR">Access Allowed List</lang>
<lang code="CZ">Access Allowed List</lang>
<lang code="DE">Access Allowed List</lang>
<lang code="DK">Access Allowed List</lang>
<lang code="EE">Access Allowed List</lang>
<lang code="EN">Access Allowed List</lang>
<lang code="ES">Lista de accesos permitidos</lang>
<lang code="FI">Pääsylista sallitut</lang>
<lang code="FR">Liste des accès autorisés</lang>
<lang code="GB">Access Allowed List</lang>
<lang code="HU">Hozzáférés Engedély Lista</lang>
<lang code="IT">Elenco accessi consentiti</lang>
<lang code="NL">Access Allowed List</lang>
<lang code="NO">Liste over systemtilgang</lang>
<lang code="PL">Access Allowed List</lang>
<lang code="RU">Access Allowed List</lang>
<lang code="SE">Använda tillåten lista</lang>
</string>
<string code="10000">
<lang code="AR">المطبوعة:</lang>
<lang code="CZ">Vytisknuto:</lang>
<lang code="DE">Gedruckt:</lang>
<lang code="DK">Printed:</lang>
<lang code="EE">Prinditud:</lang>
<lang code="EN">Printed:</lang>
<lang code="ES">Impreso:</lang>
<lang code="FI">Tulostettu:</lang>
<lang code="FR">Imprimé:</lang>
<lang code="GB">Printed:</lang>
<lang code="HU">Nyomtatott:</lang>
<lang code="IS">Printed:</lang>
<lang code="IT">Stampato:</lang>
<lang code="NL">Afgedrukt:</lang>
<lang code="NO">Skrevet ut</lang>
<lang code="PL">Wydrukowano:</lang>
<lang code="RU">Ðапечатано:</lang>
<lang code="SE">Utskrivet:</lang>
</string>
</momlang><pre></pre><pre></pre><pre></pre>
When people make you see red, be thankful your not colour blind.
modified on Thursday, September 11, 2008 8:47 AM
|
|
|
|
|
Hello,
OK I have worked out the below code to return the 'EN' string if I supply the string code, say "1000".
What I need to know is understand how to search for the string and return the string code. If I would use a wildcard in this it would be great.
Any Thoughts???
Private Sub XPathSearch(ByVal XMLPath As String)
Dim xmlNI As XPathNodeIterator
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Try
xpathDoc = New XPathDocument(XMLPath)
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/MOMLANG/STRING[@code='" & stringValue & "']/LANG[@code='EN']")
While (xmlNI.MoveNext())
'Me.RichTextBox1.AppendText(xmlNI.Current.Name + " : " + xmlNI.Current.Value & vbCrLf)
Me.RichTextBox1.AppendText("String value: " + xmlNI.Current.Value & vbCrLf)
End While
Catch ex As XPathException
System.Console.WriteLine("XMLException: " + ex.Message)
Catch ex As Exception
System.Console.WriteLine("Exception: " + ex.Message)
End Try
End Sub
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I have XML as well as its XSL, what is needed is to send this xml to email as html in body and i want to do it using Microsoft XML, v3.0 which comes with IE.
|
|
|
|
|
Do you have a question?
led mike
|
|
|
|
|
Yes, Actually I am working in Microsoft Dynamics NAV.
Here for using XML I can use 'Microsoft XML, v3.0'
and I have 1 xml, and 1 xsl given below
XSL:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html>
<head />
- <body style="FONT-FAMILY: Tahoma;">
- <table border="0" width="100%">
- <!-- Main Table
-->
- <tr>
- <!-- The only row of main table
-->
- <!-- For Image
-->
- <table>
- <tr>
<img src="1.jpg" />
</tr>
</table>
<br />
- <!-- End For Image
-->
- <h3>
Dear
<xsl:value-of select="CUSTHTLVOUCHER/CUSTOMERNAME" />
</h3>
- <xsl:for-each select="CUSTHTLVOUCHER/TEXT">
- <table>
- <tr>
- <td style="FONT-SIZE: 10pt;">
- <p>
<xsl:value-of select="@LINE" />
</p>
</td>
</tr>
</table>
</xsl:for-each>
<br />
- <xsl:for-each select="CUSTHTLVOUCHER/HOTEL">
- <div style="BACKGROUND-COLOR: blue; WIDTH: 100%;">
- <table width="100%" style="BACKGROUND-COLOR: blue;">
- <tr>
- <td align="left" style="COLOR: white; FONT-WEIGHT: bold; FONT-SIZE: 10pt;">
<xsl:value-of select="LBL1" />
</td>
- <td align="right" style="COLOR: white; FONT-WEIGHT: bold; FONT-SIZE: 10pt;">
Booking Id :
<xsl:value-of select="BOOKINGID" />
</td>
</tr>
</table>
</div>
<br />
- <DIV align="center">
- <TABLE id="tblMain" style="Z-INDEX: 106; LEFT: 72px; POSITION: static; TOP: 352px" cellSpacing="0" cellPadding="0" width="80%" align="center" border="1" bordercolor="#0099ff">
- <TR>
- <TD style="FONT-SIZE: 12pt; FONT-WEIGHT: bold; COLOR: white; BACKGROUND-COLOR: #0099ff" colSpan="3" height="15">
- <DIV id="lblHotelName">
<xsl:value-of select="NAME" />
</DIV>
</TD>
</TR>
- <TR>
- <td colspan="3">
- <table width="100%" border="0">
<tr height="15" />
- <tr>
<td align="right">Check-In:</td>
- <td>
- <div id="lblCheckIn" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="CHECKINDATE" />
</div>
</td>
<td align="right">Check-Out:</td>
- <td>
- <div id="lblCheckOut" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="CHECKOUTDATE" />
</div>
</td>
<td align="right">Rooms:</td>
- <td>
- <div id="lblRooms" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="ROOMS" />
</div>
</td>
<td align="right">Guests:</td>
- <td>
- <div id="lblGuests" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="GUESTS" />
</div>
</td>
</tr>
- <tr>
<td />
- <td>
- <div id="lblCheckInTime" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="CHECKINTIME" />
</div>
</td>
<td />
- <td>
- <div id="lblCheckOutTime" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">
<xsl:value-of select="CHECKOUTTIME" />
</div>
</td>
<td />
<td />
<td />
<td />
</tr>
- <tr>
<td />
<td />
<td />
<td />
- <td colspan="4">
<div id="lblRoomDetail" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black">Room 1:1 Adult, 0 Child</div>
</td>
</tr>
- <tr>
<td />
</tr>
</table>
</td>
</TR>
- <TR>
<td align="center" style="FONT-WEIGHT: bold">Room Options</td>
<td align="center" style="FONT-WEIGHT: bold">Inclusions</td>
<td align="center" style="FONT-WEIGHT: bold">Guest Name</td>
</TR>
- <TR>
- <td>
- <div id="lblRoomOptions" style="FONT-SIZE: 10pt;">
<xsl:value-of select="ROOMS" />
<xsl:value-of select="ROOMSOPS" />
</div>
</td>
- <td>
- <div id="lblInclusions" style="FONT-SIZE: 10pt;">
<xsl:value-of select="INCLUSIONS" />
</div>
</td>
- <td>
- <div id="lblHotelAddress" style="FONT-SIZE: 10pt;">
<xsl:value-of select="CLIENTNAME" />
<br />
</div>
</td>
</TR>
</TABLE>
</DIV>
<br />
</xsl:for-each>
- <!-- End of Hotel Tag Loop
-->
<br />
<br />
<br />
- <xsl:for-each select="CUSTHTLVOUCHER/FOOTERTEXT">
- <table>
- <tr>
- <td style="FONT-SIZE: 10pt;">
- <p>
<xsl:value-of select="@LINE" />
</p>
</td>
</tr>
</table>
</xsl:for-each>
- <!-- End of XSL
-->
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML :
<?xml-stylesheet type="text/xsl" href="my.xsl"?>
<CUSTHTLVOUCHER><CUSTOMERNAME>Casa De </CUSTOMERNAME><TEXT LINE="some text."/><HOTEL><CLIENTNAME>MAX</CLIENTNAME><BOOKINGID>4398537</BOOKINGID><LBL1>1 Room(s) for 2 Night</LBL1><CHECKINDATE>04/18/08</CHECKINDATE><CHECKINTIME>12 pm</CHECKINTIME><CHECKOUTDATE>04/20/08</CHECKOUTDATE><CHECKOUTTIME>12 pm</CHECKOUTTIME><ROOMS>1</ROOMS><GUESTS>2</GUESTS><ROOMSOPS>Single</ROOMSOPS><INCLUSIONS>Breakfast#Two bottles of mineral water complimentary in room#Usage of Swiming Pool#</INCLUSIONS></HOTEL><TEXT LINE="The amount payable by MakeMyTrip for this booking is Rs. 8,930 including all taxes. Please email us at hotelpartner@makemytrip.com if there is any discrepancy in this payment amount."/><TEXT LINE="Line Text"/><FOOTERTEXT LINE="Sincerely,"/><FOOTERTEXT LINE="UR"/></CUSTHTLVOUCHER>
AND MY CODE IS
CREATE(xml);
CREATE(xsl);
CREATE(xmlOut);
xml.load('XML1.xml');
xsl.load('XSL1.xsl');
IF xsl.parseError.errorCode <> 0 THEN
MESSAGE('%1',xsl.parseError.reason);
xml.transformNodeToObject(xsl,xmlOut);
xmlOut.save('C:\Documents and Settings\Brij\Desktop\New Folder\mail.xml');
My requirement is to conver the XML using XSL to HTML so that
I can send that xml as mail
|
|
|
|