XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 10th, 2004, 05:52 AM
yskh yskh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 43 yskh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
how can this be done in XML???

Hi,
i need clarification regarding the following:

1) is it possible to embed a text file(eg: data.txt) as tags in XML?

eg; <area>D:\mydocuments\data.txt</area>

2) if yes, is it possible to extract data values from a single column in the text file and display it using XSL?

thanks in advance.
also,
I want the users' form selections to be written back as xml when the html form is submitted. Is there a way to do this?

Reply With Quote
  #2  
Old March 10th, 2004, 11:15 AM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
1. I believe that whatever is contructing your XML will need to read in the file and that add the text from the file to the element as text data. Make sure that all special XML characters are propertly taken care of when you do this. What language are you using to construct your XML?

2. If when you say column, you mean character n from every line, this can be done. I can write a template that takes character N from every line that is seperated by a newline.

Quote:
I want the users' form selections to be written back as xml when the html form is submitted. Is there a way to do this?

Yes, depending on what language you are using on the server ... you can set the response mime type to "text/xml" and just feed the XML document through whatever object that represents your response.

Reply With Quote
  #3  
Old March 10th, 2004, 12:09 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
I am writing the template now.

Reply With Quote
  #4  
Old March 10th, 2004, 12:22 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
This is an XSL template that can be used to extract a column from a text file:
Code:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
	<xsl:call-template name="getColumn">
		<xsl:with-param name="content" select="rootNode"/>
		<xsl:with-param name="columnNumber" select="6"/>
	</xsl:call-template>
</xsl:template>

<xsl:template name="getColumn">
	<xsl:param name="content"/>
	<xsl:param name="columnNumber" select="1"/>

	<xsl:variable name="LINE_SEPERATOR" select="'
'"/>
	
	<xsl:if test="string-length($content) > 0">
		<xsl:value-of select="substring($content, $columnNumber, 1)"/>
		<xsl:call-template name="getColumn">
			<xsl:with-param name="content" select="substring-after($content, $LINE_SEPERATOR)"/>
			<xsl:with-param name="columnNumber" select="$columnNumber"/>
		</xsl:call-template>
	</xsl:if>
	
</xsl:template>

</xsl:stylesheet>

Test XML:
Code:
<?xml version="1.0"?>
<rootNode>Line 1
Line 2
Line 3
Line 4
Line 5</rootNode>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > how can this be done in XML???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT