Scripts posted recently tagged to xml in Kelpi

1- 10 of 13.

Simple ajax function

to ajax xml javascript by nando.quintana

function ajax(url,callback) {
  try {
    req = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {

MovableType to Bitakora transformer

to blog xml bitakora movabletype by mikel

__doc__ = ''' MT TXT 2 Bitakora XML '''
FILENAME = 'migration_ueu365.txt'
POST_DELIMITER = '--------\n'
BODY_DELIMITER = '-----\n'
from StringIO import StringIO

PHP Convert XML to Array

to php xml array convert by anonymous

function xml2array($object) {
	$return = NULL;
	if(is_array($object)) {
		foreach($object as $key => $value) $return[$key] = xml2array($value);
	} else {

Check existence of elements in XML

to xml javascript check by garaolaza

// When XML processing with JavaScript, sometimes void XML elements give strange answers about them
// I needed to check if the element was void, just like <item/>

if (somewhere.getElementsByTagName('item')[0].childNodes.length) {  dothis();  }

Set the selected attribute on a select box

to zope plone tal xml by nando.quintana

<option value="this_value" tal:attributes="selected python:test(my_value=='this_value','selected',)">this value</option>

XML to list of dict parsing

to python xml parsing bigfiles by garaolaza

from lxml import etree
coords = etree.parse("/path/to/your/xml/file").getroot()
coords_list = []
for coord in coords:
        this = {}

Buscar en un texto lo que encierra una etiqueta

to xml parser python by nando.quintana

# recibe un tag y busca el texto que hay entre el <tag> y el </tag>
def pieceoftext(content, tag, start_point=0):
     start_tag = '<'+tag+'>'
     end_tag = '</'+tag+'>'
     start_point = content.find(start_tag,start_point)

configure.zcml - memcached lovely package for zope3

to xml zcml zope3 memcached by nando.quintana

<configure 
    xmlns="http://namespaces.zope.org/zope"
    xmlns:zcml="http://namespaces.zope.org/zcml"
    i18n_domain="zope"
    >

Validador de sintaxis XML (no DTD ni schema)

to python XML Validador chorradilla by jonbaine

import sys
import xml.sax
if len(sys.argv) < 2 :
	print 'USAGE: '+sys.argv[0]+' <nombre_de_archivo_xml>'
	quit()

Configure some security views for PAU

to xml zcml zope3 by nando.quintana

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:browser="http://namespaces.zope.org/browser"
           xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
           xmlns:i18n="http://namespaces.zope.org/i18n"
           i18n_domain="kelpi" >
hits counter