How to create news ticker XML file in Joomla? - joomla2.5

I got this extensions and all I want to know is how I am able to get the news ticker from XML file and how should I create this file?
I tried this one and it is not working.
XML file
http://www.4shared.com/document/uNJ9sdmD/newsxml.html
Extension link
http://extensions.joomla.org/extensions/news-display/articles-display/news-tickers-a-scrollers/6633?qh=YToxMDp7aTowO3M6NDoibmV3cyI7aToxO3M6MzoibmV3IjtpOjI7czo3OiJuZXduZXNzIjtpOjM7czo1OiInbmV3cyI7aTo0O3M6NToibmV3J3MiO2k6NTtzOjY6Im5ld2VseSI7aTo2O3M6NToibmV3cyciO2k6NztzOjY6Im5ld3MnLCI7aTo4O3M6NjoiJ25ldycsIjtpOjk7czo2OiInbmV3cyciO30%3D

First create the XML file and insert it in the correct directory
/modules/mod_highlighter_gk4/xml --> this is where you need to insert the file.
You can find a sample XML file named Sample on that folder which tells you exactly how to format you XML file. It's something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<highlighter>
<item>
<title>Title 1</title>
<desc>Item description 1</desc>
<link>http://item1.title.com</link>
</item>
<item>
<title>Title 1</title>
<desc>Item description 1</desc>
<link>http://item1.title.com</link>
</item>
On the module itself first make sure you select the XML file on the "data source".
Then on the XML File option put the name of the XML File you created and it should work.
You can find more info from their website as well.
http://www.gavick.com/forums/highlighter.html

Related

Delete comments from xml file while parsing it using libxml

Following is the XML file with one of its node(i.e. <date>) being commented.
<?xml version="1.0"?>
<story>
<info>
<author>Abc Xyz</author>
<!--<date>June 2, 2017</date> -->
<keyword>example keyword</keyword>
</info>
</story>
What I want is to remove that commented line/node completely from the XML file using libxml library and it should look as below:
<?xml version="1.0"?>
<story>
<info>
<author>Abc Xyz</author>
<keyword>example keyword</keyword>
</info>
</story>
I also referred the libxml documentation but that didn't helped me much with the "comment/s" in XML file.
I tried in a different way and it worked. Looks like using xmlreader for modifying the xml will not help much, instead I did xmlReadMemory(), then while parsing did following check:
if(node->type == XML_COMMENT_NODE){ //node is of type xmlNodePtr
xmlUnlinkNode(node);
xmlFreeNode(node);
}
And finally xmlDocDumpFormatMemory() to store the modified xml in xmlbuffer.
You can use NodeType() while parsing the xml and check for each node if it’s a comment (8 means comment, see here: http://xmlsoft.org/xmlreader.html#Extracting) and then remove it with xmlUnlinkNode() and xmlFreeNode().

How do I search property value of some type in XML file and write them to a text file in C++

I have 200 xml files. each one consists of pathways (something like network information). each pathway consists of entities with some attributes. I would like to ask how I can creat a text file for each xml file that contain the only name attributes for all the entities inside this xml file. I have the xml files in this format:
<?xml version="1.0" ?>
<!DOCTYPE pathway (View Source for full doctype...)>
- <!-- Creation date: Oct 7, 2014 11:01:31 +0900 (GMT+09:00) -->
- <pathway name="path:gmx00010" org="gmx" number="00010" title="Glycolysis / Gluconeogenesis">
- <entry id="13" name="gmx:100527532 gmx:100775844 gmx:100778363 gmx:100786504 gmx:100792394
gmx:100795446 gmx:100798677 gmx:100802732 gmx:100815070 gmx:100818383 gmx:100818915 gmx:547751"
type="gene" >
</entry>
- <entry id="37" name="gmx:100777399 gmx:100778722 gmx:100782019 gmx:100783726 gmx:100784210
gmx:100786773 gmx:100798020 gmx:100798892 gmx:100800699 gmx:100803104 gmx:100808513
gmx:100809812 gmx:100811186 gmx:100811501 gmx:100811891 gmx:100816594 gmx:100817701
gmx:100819197 gmx:547717" type="gene">
</entry>
- <entry id="38" name="ko:K01905" type="ortholog">
</entry>
- <entry id="39" name="ko:K00129" type="ortholog">
</entry>
I want to write a program in visual C++ to create a text file with the same title as the xml file and this text file contains the name attribute values (ex: gmx:100527532 gmx:100775844 gmx:100778363 gmx:100786504 gmx:100792394 gmx:100795446 gmx:100798677 gmx:100802732 gmx:100815070 gmx:100818383 gmx:100818915 gmx:547751) for all the entities of type="gene" and ignore any entity with other types.
Thanks.

error printing report <traceback object at 0x06F19DC8>)?

I want to print a report. I have a module named partnership is under the addons folder. and under the partnership folder I carry the folder that contains new_report.rml new_report.sxw and new_report.py class containing this code:
import time
from openerp.report import report_sxw
class new_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(new_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {'time': time,})
report_sxw.report_sxw('report.new.report', 'contratcommercial',
'addons/partnership/report/new_report.rml',
parser=new_report)
under addons / partnership partnership I report.xml containing this code:
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<report
auto="False"
id="new_report_id"
model="contratcommercial"
name="commercial_report"
rml="partnership/report/new_report.rml"
string="imprimer contrat "/>
</data>
</openerp>
but I still have this error
report.commercial_report (<type 'exceptions.KeyError'>, KeyError(u'report.commercial_report',), <traceback objectat 0x06F19DC8>)
Your report id is given wrong.name attribute of <report> tag is same as in .py side. Just put ahead report for example report.name.value
Try this code.
in .py side
report_sxw.report_sxw('report.commercial.report', 'contratcommercial',
'addons/partnership/report/new_report.rml',
parser=new_report)
in .xml side
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<report
auto="False"
id="new_report_id"
model="contratcommercial"
name="commercial.report"
rml="partnership/report/new_report.rml"
string="imprimer contrat "/>
</data>
</openerp>
Hope this will solve your problem.

Removing specific element from xml using sax with xerces library in c++

My problem is that I want to remove lastfiles and all it's child element using sax with the API of Xerces in c++ language??
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE config>
<config datecreated="20011210">
<user>
John Smith
</user>
<login>jsmith</login>
<password>topsecret</password>
<lastfiles>
<lastfile timestamp="20011210T1002">accounts.txt</lastfile>
<lastfile timestamp="20011190T1132">/home/jsmith/docs/letter.doc</lastfile>
</lastfiles>
</config>

XercesDOMParser and XIncludes

I am attempting to get xincludes working in an existing system that uses a XercesDOMParser in xercesc to parse incoming xml from a client. I am working with Apache Xercesc v3.0.1, and the incoming XML, read from an input stream, is:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="testguioutput.xml" />
while testguioutput.xml contains
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
The existing code uses a wrapper around a XercesDOMParser to parse the XML as it comes in, and after using setDoNamespaces and setDoXInclude to true, it is attempting to parse the XInclude, but I get a persistent "Fatal: include failed and no fallback element found in document '{0}'" error, no matter where in the directory structure I put testguioutput.xml.
I am working under visualstudio 2008, my working directory is default, and running out of /project/debug, but the include fails whether the target file is in /project/ or /project/debug/.
I was able to expand the xinclude tags using the XInclude.exe sample application that is included with the Xerces application. To do this, I created two files using your files above:
test1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="test2.xml"/>
</CompositeObject>
</VisionServer>
test2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
At the command line I executed:
"XInclude.exe test1.xml test1_expanded.xml" without quotes.
The resulting test1_expanded.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<VisionServer xmlns="" xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<GUIOutput xml:base="test2.xml">
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
</CompositeObject>
</VisionServer>