Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2015, 06:44 PM
Registered User
 
Join Date: Aug 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Convert XML to RDF using xslt

I am beginner to xml /rdf /xslt . I have an XML file and want to transform into RDF file using XSLT.i did not get the desired rdf format by xslt file. Please help me to improve my xslt file :(

My XML file is
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Events><Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'>
<System>
<Provider Name='Application Hang'/>
<EventID Qualifiers='0'>1002</EventID>
<Level>2</Level>
<Task>101</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime='2015-08-08T09:47:28.000000000Z'/>
<EventRecordID>3005</EventRecordID>
<Channel>Application</Channel>
<Computer>AAAA</Computer>
<Security/>
</System>
<EventData>
<Data>LiveComm.exe</Data>
<Data>17.5.9600.20911</Data>
<Data>bd4</Data>
<Data>01d0d1be80c57fd9</Data>
<Data>4294967295</Data>
<Data>C:\Program Files\WindowsApps\microsoft.windowscommunicationsapps_17.5.9600.20911_x64__8wekyb3d8bbwe\LiveComm.exe</Data>
<Data>7443f7db-3db2-11e5-8261-a45d36cd4a42</Data>
<Data>microsoft.windowscommunicationsapps_17.5.9600.20911_x64__8wekyb3d8bbwe</Data>
<Data>ppleae38af2e007f4358a809ac99a64a67c1</Data>
<Binary>55006E006B006E006F0077006E0000000000</Binary>
</EventData>
</Event>
My XSLT File is
Code:
<xsl:transform version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match='Correlation'>
<Correlation-patricia>
<xsl:apply-templates />
</Correlation-patricia>
</xsl:template>

<xsl:template match='TimeCreated'>
<TimeCreated-patricia>
<xsl:apply-templates />
</TimeCreated-patricia>
</xsl:template>

<xsl:template match='Task'>
<Task-patricia>
<xsl:apply-templates />
</Task-patricia>
</xsl:template>

<xsl:template match='Keywords'>
<Keywords-patricia>
<xsl:apply-templates />
</Keywords-patricia>
</xsl:template>

<xsl:template match='ErrorCode'>
<ErrorCode-patricia>
<xsl:apply-templates />
</ErrorCode-patricia>
</xsl:template>

<xsl:template match='Provider'>
<Provider-patricia>
<xsl:apply-templates />
</Provider-patricia>
</xsl:template>

<xsl:template match='Opcode'>
<Opcode-patricia>
<xsl:apply-templates />
</Opcode-patricia>
</xsl:template>

<xsl:template match='ProcessingErrorData'>
<ProcessingErrorData-patricia>
<xsl:apply-templates />
</ProcessingErrorData-patricia>
</xsl:template>

<xsl:template match='DataItemName'>
<DataItemName-patricia>
<xsl:apply-templates />
</DataItemName-patricia>
</xsl:template>

<xsl:template match='System'>
<System-patricia>
<xsl:apply-templates />
</System-patricia>
</xsl:template>

<xsl:template match='Security'>
<Security-patricia>
<xsl:apply-templates />
</Security-patricia>
</xsl:template>

<xsl:template match='Event'>
<Event-patricia>
<xsl:apply-templates />
</Event-patricia>
</xsl:template>

<xsl:template match='Execution'>
<Execution-patricia>
<xsl:apply-templates />
</Execution-patricia>
</xsl:template>

<xsl:template match='EventID'>
<EventID-patricia>
<xsl:apply-templates />
</EventID-patricia>
</xsl:template>

<xsl:template match='Channel'>
<Channel-patricia>
<xsl:apply-templates />
</Channel-patricia>
</xsl:template>

<xsl:template match='Computer'>
<Computer-patricia>
<xsl:apply-templates />
</Computer-patricia>
</xsl:template>

<xsl:template match='EventData'>
<EventData-patricia>
<xsl:apply-templates />
</EventData-patricia>
</xsl:template>

<xsl:template match='Binary'>
<Binary-patricia>
<xsl:apply-templates />
</Binary-patricia>
</xsl:template>

<xsl:template match='Version'>
<Version-patricia>
<xsl:apply-templates />
</Version-patricia>
</xsl:template>

<xsl:template match='Level'>
<Level-patricia>
<xsl:apply-templates />
</Level-patricia>
</xsl:template>

<xsl:template match='EventRecordID'>
<EventRecordID-patricia>
<xsl:apply-templates />
</EventRecordID-patricia>
</xsl:template>

<xsl:template match='EventPayload'>
<EventPayload-patricia>
<xsl:apply-templates />
</EventPayload-patricia>
</xsl:template>

<xsl:template match='Events'>
<Events-patricia>
<xsl:apply-templates />
</Events-patricia>
</xsl:template>

<xsl:template match='Data'>
<Data-patricia>
<xsl:apply-templates />
</Data-patricia>
</xsl:template>

</xsl:transform>
kindly help me to convert XML to RDF .....

Last edited by mid_smile; August 9th, 2015 at 06:46 PM..
 
Old August 10th, 2015, 03:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

What do you want the output to look like? What is the problem with your output at the moment..

Assume for a moment we don't know what RDF is and we don't know what you know...
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old August 10th, 2015, 04:30 AM
Registered User
 
Join Date: Aug 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want my output in rdf format but this xslt give me xml output .
i dont know how this xslt file give me RDF output.
 
Old August 10th, 2015, 04:57 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

What is RDF? Show us what you want your output to look like.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old August 10th, 2015, 08:05 AM
Registered User
 
Join Date: Aug 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want this output for my xml file by using xslt.
but i dont have enough skill to creating XSLT for this output:
Code:
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:convert="http://www.w3.org/property/" > 
 <rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1">
    <convert:hasResource rdf:resource="http://www.w3.org/Resource/Events/Event1/EventData"/>
    <convert:hasResource rdf:resource="http://www.w3.org/Resource/Events/Event1/System"/>
    <convert:xmlns>http://schemas.microsoft.com/win/2004/08/events/event</convert:xmlns>
  </rdf:Description>

 <rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1/EventData">

<convert:Data>4294967295</convert:Data>
<convert:Data>7443f7db-3db2-11e5-8261-a45d36cd4a42</convert:Data>
<convert:Binary>55006E006B006E006F0077006E0000000000</convert:Binary>
</rdf:Description>
<rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1/System">
    <convert:Level>2</convert:Level>
<convert:Task>101</convert:Task>
<convert:Keywords>0x80000000000000</convert:Keywords>
<convert:EventRecordID>3005</convert:EventRecordID>
<convert:Channel>Application</convert:Channel>
<convert:Computer>AAAA</convert:Computer>
<convert:hasResource rdf:resource="http://www.w3.org/Resource/Events/Event1/System/TimeCreated"/>
 <convert:hasResource rdf:resource="http://www.w3.org/Resource/Events/Event1/System/EventID"/>
<convert:hasResource rdf:resource="http://www.w3.org/Resource/Events/Event1/System/Provider"/>
  </rdf:Description>
 
<rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1/System/TimeCreated">
    <convert:SystemTime>2015-08-08T09:47:28.000000000Z</convert:SystemTime>
  </rdf:Description>

<rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1/System/EventID">
    <convert:EventID>1002</convert:EventID>
    <convert:Qualifiers>0</convert:Qualifiers>
  </rdf:Description>
<rdf:Description rdf:about="http://www.w3.org/Resource/Events/Event1/System/Provider">
    <convert:Name>Application Hang</convert:Name>
  </rdf:Description>

</rdf:RDF>
 
Old August 10th, 2015, 11:32 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I think you need to find some basic tutorials (or by the Wrox book!) on XSLT and try to learn this stuff yourself. Unfortunately, as helpful as we try to be we don't have the time to do your work for you.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert XML to RDF deean XSLT 18 May 7th, 2013 03:31 AM
Convert XML file using XSLT sushil.sharma75 XSLT 13 November 20th, 2009 01:59 PM
Subject: Convert XML using XSLT manoj1984 XSLT 6 May 30th, 2008 04:27 PM
Appending child nodes to a RDF/OWL file using xslt sesath XSLT 2 May 10th, 2007 04:37 AM
Using XSLT to convert XML to a table ? nobitavn94 XSLT 3 October 30th, 2006 11:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.