view release on metacpan or search on metacpan
redland/ChangeLog.3 view on Meta::CPAN
* raptor/tests/Makefile.am: Added ex-42
* raptor/tests/ex-42.out, raptor/tests/ex-42.rdf: rdf:bagID
* raptor/tests/bad-04.rdf: Check rdf:ID and rdf:bagID with same
value fails
* raptor/tests/bad-02.rdf: Duplicate rdf:ID names
* raptor/raptor_parse.c: Make debug less chatty about cdata,
unless RAPTOR_DEBUG_CDATA defined.
* raptor/raptor_parse.c (raptor_record_ID): Added, notes rdf:ID
and rdf:bagID values, checks for duplicates (per in-scope
base-URI).
(raptor_free_ID_list): Added, frees structure above.
(raptor_xml_start_element_handler): Handle xml:base using
raptor_new_uri_for_xmlbase to strip/fix parts that aren't used.
(raptor_start_element_grammar): Check for illegal rdf:ID,
rdf:bagID and rdf:nodeID using raptor_valid_xml_ID. Check for
redland/ChangeLog.3 view on Meta::CPAN
(Change to the SWIG calling convention in newer version)
2002-09-19 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* NEWS.html: Update old N-Triples link
* raptor/Makefile.am:
Restore rule to make librdf.la for when embedded in Redland
* raptor/raptor_libxml.c (raptor_libxml_init):
Enable handling of cdata blocks -
<![CDATA[...]> by registering callback to raptor_xml_cdata_handler
* raptor/tests/ex-40.out: Fix node
* raptor/tests/Makefile.am: Added ex-40
* raptor/tests/ex-40.out, raptor/tests/ex-40.rdf:
Check XML CDATA sections
* raptor/Makefile.am:
dist-hook added to copy pre-built README and NEWS to release
redland/ChangeLog.3 view on Meta::CPAN
Tidying header files.
stdarg.h required for all sources now.
Remove rdf_*.h headers that are included by librdf.h
* librdf/rdf_storage_hashes.c:
revert default number hashes to 3 for now
* librdf/Makefile.am:
Always have compiled java class files in distribution.
* raptor/raptor_parse.c (raptor_xml_cdata_handler):
Allow to be ignored when there is no
element (XML very damaged)
* raptor/rdfdump.c: Tidy output formatting
* raptor/raptor_libxml.c:
Delete extra '\n' at end of XML parsing messages; that's up to the
app to add.
* raptor/raptor_parse.c: Removed some \n-s from warning/error messages
redland/ChangeLog.4 view on Meta::CPAN
* librdf/rdf_serializer_rdfxml.c:
Some more unsigned char fixes for URIs
(librdf_serializer_print_statement_as_rdfxml): Try harder to find a
maximal length legal property element name; now works for
foaf:mbox_sha1sum - patch from Morten
* docs/api.sgml.in, docs/Makefile.am:
Added storage_mysql storage_tstore
* raptor/raptor_xml_writer.c:
Use raptor_stringbuffer to better grow the output cdata.
* raptor/raptor_stringbuffer.c: stringbuffer now uses unsigned char
Removed raptor_new|free_stringbuffer_node - used once, now inlined.
(raptor_stringbuffer_append_string_common): Added with
common append code merged here.
(raptor_stringbuffer_append_counted_string,
raptor_stringbuffer_append_string): Added do_copy arg.
(main): Test code updated for api changes.
* raptor/raptor_internal.h:
redland/ChangeLog.4 view on Meta::CPAN
* raptor/Makefile.am:
Remove maintainer only n3 lex/yacc rules (flex/bison)
Post process the bison output to remove unused label to make g++ happier.
* raptor/raptor_internal.h:
Added raptor_xml_literal_datatype_uri_string for the RDF datatype
literal URI string, used several times.
raptor_check_ordinal takes unsigned char*
A couple of lengths, counts become unsigned int.
raptor_unicode_char_to_utf8, raptor_format_sax2_element,
raptor_xml_writer_cdata, raptor_xml_writer_comment,
raptor_xml_writer_as_string changed to
take/return unsigned char* for UTF8 strings.
* raptor/raptor.h:
raptor_new_uri_func, raptor_new_uri_from_local_name_func,
raptor_new_uri_relative_to_base_func, raptor_uri_as_string_func,
raptor_uri_as_counted_string_func URI factory methods
changed to all take/return unsigned char* for URI strings
raptor_statement_part_as_counted_string,
raptor_statement_part_as_string,
redland/ChangeLog.4 view on Meta::CPAN
Changed to use unsigned char* for URI strings, char* for filenames
2003-12-01 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor/raptor_set.c (raptor_set_stats_print): Debug printing tweak.
2003-11-28 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor/raptor_internal.h:
raptor_check_ordinal with now unsigned char* arg
raptor_sax2 content_cdata now unsigned char*
* raptor/raptor_general.c (raptor_check_ordinal): unsigned char *name
* raptor/raptor_parse.c: Lots of char/unsigned char casting.
* raptor/n3_common.h: Undo n3_syntax_error back to raptor_parser arg.
* raptor/n3_parser.y: (n3_parser_error) aka yyerror; take a void arg.
* raptor/n3_common.h:
redland/ChangeLog.4 view on Meta::CPAN
Added raptor_stringbuffer.c raptor_stringbuffer_test code
* raptor/raptor.h: Added raptor_stringbuffer.
* raptor/raptor_stringbuffer.c: Stringbuffer class for growing strings
* raptor/raptor_libxml.c (raptor_libxml_init):
With libxml2 use raptor_xml_characters_handler
for sax->characters.
* raptor/raptor_parse.c (raptor_cdata_grammar): Added is_cdata arg.
(raptor_xml_characters_handler): Added, calling raptor_cdata_grammar.
(raptor_xml_cdata_handler): Updated to call raptor_cdata_grammar with
is_cdata=1.
(raptor_xml_parse_init): With expat use raptor_xml_characters_handler
with XML_SetCharacterDataHandler.
(raptor_cdata_grammar): Tidy error reporting; do not use
raptor_xml_writer_as_string for a simple print.
* raptor/raptor_internal.h:
Added raptor_xml_characters_handler prototype.
2003-11-26 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* perl/Makefile.PL:
List the .pm files explicitly since perl 5.8.1 broke scanning
redland/ChangeLog.4 view on Meta::CPAN
URI string pointer. For rdf:ID, do not allocate the URI twice.
* raptor/raptor_parse.c (raptor_generate_statement):
Do not set language when a datatype is given.
* raptor/raptor_xml_writer.c (raptor_new_xml_writer):
Initialise writer buffer to an empty string
to start (i.e. just \0).
(raptor_xml_writer_start_element): Now assume buffer is always
present, remove empty buffer case.
(raptor_xml_writer_end_element,raptor_xml_writer_cdata): Handle 0
length case, no strncpy.
* raptor/tests/Makefile.am: Added ex-51.
Fix daml+oil test.
* raptor/tests/ex-51.out, raptor/tests/ex-51.rdf:
Check empty XML literal works
* raptor/tests/ex-41.out: No language for datatyped literals.
redland/ChangeLog.4 view on Meta::CPAN
* librdf/Makefile.am: Removed rdf_memory.c
* librdf/rdf_memory.c: Memory debugging code superceeded by better
external tools such as dmalloc
* librdf/rdf_hash_bdb.c, configure.ac:
Added BDB 4.0 and 4.1 open interface support - 6 or 7 arguments.
* raptor/raptor_xml_writer.c:
(raptor_xml_writer_end_element) Reset the current_element pointer
on finishing. Makes any succeeding cdata do the right thing.
* librdf/redland.spec.in: Updates for new perl module names
* raptor/rdfdump.c: Inside redland, don't call raptor_init/finish,
it's done by redland's world.
2003-08-13 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor/raptor_rss.c (raptor_rss_parse_chunk):
Stop working aftera a user abort of the parser.
redland/ChangeLog.4 view on Meta::CPAN
(raptor_generate_id): Add user_bnodeid and pass on.
* raptor/raptor_internal.h: Added raptor_xml_writer_comment
* raptor/raptor_namespace.c (raptor_namespace_copy):
Don't copy uri and then lose it.
* raptor/raptor_xml_writer.c:
Added current_element for tracking empty/not empty elements.
(raptor_xml_writer_comment): Added, just concatenating the content
via raptor_xml_writer_cdata.
* raptor/raptor_parse.c (raptor_xml_comment_handler):
Call raptor_xml_writer_comment inside
parseType="Literal"
* raptor/raptor_xml_writer.c: raptor_xml_writer gains stack depth.
(raptor_free_xml_writer): Clear any content_cdata before finishing.
(raptor_xml_writer_start_element)
Add depth to raptor_format_sax2_element calls. Increase it
(raptor_xml_writer_start_element,raptor_xml_writer_end_element):
Add depth to raptor_format_sax2_element calls. Decrease it
and raptor_namespaces_end_for_depth each time.
* raptor/raptor_namespace.c:
Moved error_handler and error_data arguments around.
(raptor_namespaces_start_namespace) Gets those as arguments
(raptor_namespaces_start_namespace) Added, simpler version of _full
redland/ChangeLog.4 view on Meta::CPAN
present.
copy namespaces to new stack when new ones are needed.
* raptor/raptor_internal.h:
Add error_handler and error_data to namespace_stack.
raptor_namespaces_start_namespace gets those as arguments
raptor_namespace_new looses them
raptor_namespaces_start_namespace takes less args
raptor_namespaces_start_namespace_full added
raptor_namespace_copy added
content_cdata_seen and content_element_seen back into sax2_element
* raptor/raptor_parse.c:
Moved content_cdata_seen and content_element_seen back into
sax2_element.
Update for new raptor_namespaces_start_namespace calling convention.
* raptor/raptor_xml_writer.c: Debug
* raptor/raptor_namespace.c (raptor_namespaces_format):
Fix missing counting : when present
* raptor/tests/ex-11.rdf, raptor/tests/ex-11.out:
Updated to declare the html namespace as default, expect it in the
redland/ChangeLog.4 view on Meta::CPAN
raptor_format_sax2_element now takes a raptor_namespace_stack
2003-07-27 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor/raptor_internal.h:
raptor_xml_writer prototypes take unsigned char*
* raptor/raptor_parse.c:
Move the code building parseType="Literal" strings to
raptor_xml_writer class.
(raptor_cdata_grammar): Added, just for symmetry mostly, with most
code taken from raptor_xml_cdata_handler.
* raptor/raptor_xml_writer.c:
Move the code building parseType="Literal" strings to
raptor_xml_writer class.
* raptor/Makefile.am: Added raptor_xml_writer.c
* raptor/raptor_xml_writer.c: Initial version
* raptor/raptor_parse.c:
Split content_cdata fields between sax2_element & (RDF/XML
specific) element.
raptor_element: Add xml_writer field.
Various calls changed to use the new raptor_simple_message_handler
for error handling implemented as raptor_parser_simple_error here.
(raptor_xml_parser_simple_error_handler): Added, matching the
raptor_simple_message_handler API and calling raptor_parser_error.
(raptor_start_element_grammar): When parseType="Literal" appears,
create a new raptor_xml_writer.
(raptor_end_element_grammar): When parseType="Literal" ends, delete
the raptor_xml_writer.
redland/ChangeLog.4 view on Meta::CPAN
Re-ordered URI functions earlier.
Various methods changed to use (public) raptor_simple_message_handler
for error handling.
* raptor/raptor_internal.h: Delete raptor_internal_message_handler.
Added prototype raptor_parser_simple_error, implementing
raptor_simple_error_handler API.
Various methods changed to use (public) raptor_simple_message_handler
for error handling.
raptor_sax2_element moved to semi-public raptor.h
rdf/xml-specific cdata parts moved from raptor_sax2_element to
raptor_element.
Added raptor_xml_writer functions.
* raptor/raptor_namespace.c:
Use (public) raptor_simple_message_handler for error handling.
2003-07-24 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor/raptor_parse.c (raptor_process_property_attributes):
NFC error message tidy.
redland/ChangeLog.4 view on Meta::CPAN
Checking escaping in parseType Literal values with XML attributes
* raptor/raptor_parse.c (raptor_format_element):
Pass in parser for UTF-8 error handling.
Use raptor_xml_escape_string for attribute values but
only malloc/free if lengths changed.
(raptor_xml_end_element_handler): Update to new
raptor_xml_escape_string API and only malloc/free it if lengths
changed.
* raptor/raptor_parse.c (raptor_xml_cdata_handler):
Use updated raptor_xml_escape_string API
* raptor/raptor.h: Added raptor_statement_part_as_counted_string,
raptor_statement_part_as_string
Changed raptor_xml_escape_string API
* raptor/raptor_general.c
(raptor_statement_part_as_counted_string,
raptor_statement_part_as_string): Added, making N-triples style
output from parts of raptor_statement.
redland/ChangeLog.4 view on Meta::CPAN
* raptor/libraptor.3: raptor_parse_chunk: Takes unsigned char buffer.
* raptor/libraptor.3:
raptor_start_parse: Note NULL base URI ok for ntriples
* raptor/libraptor.3: Typo: raptor_start_parse not raptor_parse_start
* raptor/raptor_general.c (raptor_xml_escape_string):
Make it work with 10ffff again
* raptor/raptor_parse.c (raptor_xml_cdata_handler):
Cast around raptor_xml_escape_string
* raptor/raptor_general.c (raptor_xml_escape_string):
Null terminate new string
* raptor/raptor_www_libxml.c, raptor/raptor_www.c:
Use RAPTOR_WWW_BUFFER_SIZE for I/O buffers
* raptor/raptor_internal.h:
Define RAPTOR_WWW_BUFFER_SIZE for I/O buffers
redland/ChangeLog.4 view on Meta::CPAN
Move raptor_xml_parser typedef here (still internal).
raptor_xml_parser_stats_print, raptor_set_stats_print: Defined with
RAPTOR_DEBUG
* raptor/raptor_parse.c (raptor_xml_parser_stats_print):
Defined with RAPTOR_DEBUG
* raptor/raptor_general.c (raptor_stats_print):
Defined with RAPTOR_DEBUG
* raptor/raptor_parse.c (raptor_xml_cdata_handler):
Use raptor_xml_escape_string when content
type is an XML literal
* raptor/raptor_general.c (raptor_xml_escape_string):
Now takes and returns lengths
Fix assumption of '\0' terminated strings.
(main): Update for counted strings
* raptor/raptor.h:
raptor_xml_escape_string now takes and returns lengths
redland/ChangeLog.5 view on Meta::CPAN
* raptor/raptor_qname.c (raptor_iostream_write_qname):
Added to write a qname to an iostream.
* raptor/raptor.h: Add prototypes for raptor_iostream_write_qname,
raptor_new_namespace_from_uri
* raptor/raptor_rdfxml.c (raptor_xml_start_element_handler,
raptor_xml_end_element_handler, raptor_xml_comment_handler,
raptor_start_element_grammar, raptor_end_element_grammar,
raptor_cdata_grammar): Update the use of xml_writer for building
parseType="Literal" content to use an iostream. Use more sax2
methods rather than direct access to internals - still some left.
(raptor_xml_parse_init, raptor_xml_parse_start,
raptor_xml_parse_terminate, raptor_inscope_xml_language,
raptor_inscope_base_uri): Move expat/libxml details to
raptor_new_sax2, raptor_sax2_parse_start, raptor_free_sax2,
raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri
respectively.
(raptor_xml_parse_chunk_): Deleted, moved to
raptor_sax2_parse_chunk
* raptor/raptor_xml_writer.c: Change to output to an iostream not
build up a stringbuffer.
(raptor_new_xml_writer): Add iostream arg, delete never-used
canonicalize.
(raptor_free_xml_writer): Remvoe stringbuffer.
(raptor_xml_writer_start_element, raptor_xml_writer_end_element):
Delete stringbuffer and use raptor_iostream_write_sax2_element.
(raptor_xml_writer_cdata): Delete stringbuffer and use
raptor_iostream_write_xml_escaped_string.
(raptor_xml_writer_raw): Added to write just the bytes.
(raptor_xml_writer_comment): Fixed to emit <!-- and -->
(raptor_xml_writer_as_string): Deleted.
(main): Added with test case.
* raptor/raptor_sax2.c (raptor_new_sax2, raptor_free_sax2,
raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri,
raptor_sax2_get_depth, raptor_sax2_inc_depth,
raptor_sax2_dec_depth, raptor_sax2_parse_start,
redland/ChangeLog.5 view on Meta::CPAN
* Switched to LGPL / Apache 2.0 license in the sources
CVS tags before: redland_license_lgpl_mpl,
and after: redland_license_lgpl_apache2
* rasqal/configure.ac, configure.ac: Need raptor 1.4.2
* raptor/win32_raptor_config.h, raptor/configure.ac: Bumped
version to 1.4.2
* raptor/raptor_xml_writer.c (raptor_xml_writer_cdata):
Return when raptor_xml_escape_string fails.
* raptor/raptor_xml.c (raptor_xml_escape_string):
Return -1 on UTF-8 encoding failure
* raptor/raptor_xml.c: docs
* utils/rdfproc.c (log_handler):
Check level against fatal, not facility.
redland/ChangeLog.5 view on Meta::CPAN
string is copied out; write a NUL.
* rasqal/sparql_parser.y, rasqal/rdql_parser.y,
rasqal/rasqal_query_test.c: Casts for C++
* raptor/libraptor.3: int return on raptor_xml_escape_string in body
* raptor/libraptor.3: 1.4.1 raptor_xml_escape_string return value
now int, <0 on failure.
* raptor/raptor_xml_writer.c (raptor_xml_writer_cdata):
Use int for raptor_xml_escape_string
return variables and use error return <0
* raptor/raptor_serialize.c:
(raptor_rdfxml_serialize_write_xml_attribute,
raptor_rdfxml_serialize_statement) Use int for
raptor_xml_escape_string return variables. Handle empty string
attribute when len=0.
* raptor/raptor_sax2.c (raptor_format_sax2_element):
redland/ChangeLog.5 view on Meta::CPAN
* rasqal/win32/rasqal.dsp, rasqal/win32/rasqal.dsw:
win32 updates including sparql (not tested)
* librdf/rdf_parser_raptor.c
(librdf_parser_raptor_new_statement_handler): Do not copy datatype
URIs for new statements.
* raptor/raptor_namespace.c: less namespace debugs
* raptor/raptor_xml_writer.c: less cdata debugs
* raptor/raptor_namespace.c: Make most namespace debug messages
appear only if #ifdef RAPTOR_DEBUG_VERBOSE
* raptor/raptor_rdfxml.c:
Make most rdf/xml parsing debug messages appear only if
#ifdef RAPTOR_DEBUG_VERBOSE
* librdf/rdf_serializer.c
(librdf_serializer_serialize_model_to_counted_string,
redland/ChangeLog.5 view on Meta::CPAN
use strrchr to find *last* .
2004-04-14 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* librdf/rdf_node.c (librdf_node_to_counted_string):
Encode language and datatype for
literal strings.
* raptor/raptor_sequence.c (raptor_new_sequence): Zap sequence field.
* raptor/raptor_xml_writer.c (raptor_xml_writer_cdata):
Do not copy more bytes than allowed.
* raptor/Makefile.am: Added raptor_expat.c
* raptor/raptor_parse.c: Export some expat-only handlers:
raptor_xml_unparsed_entity_decl_handler,
raptor_xml_external_entity_ref_handler.
(raptor_xml_parse_init): Do not call expat init code here.
(raptor_xml_parse_start): Call new aptor_expat_init to initialise
parser state.
redland/ChangeLog.6 view on Meta::CPAN
* raptor/src/raptor_serialize_rdfxml.c
(raptor_rdfxml_serialize_start): Pass down xml_version to the
raptor_xml_writer and write the versioned header.
* raptor/src/raptor_xml_writer.c: Add xml_version to
raptor_xml_writer structure.
(raptor_iostream_write_xml_element_start): Add xml_version field
and pass it down to the XML escape function.
(raptor_new_xml_writer): Init xml_version to 10.
(raptor_xml_writer_empty_element, raptor_xml_writer_start_element,
raptor_xml_writer_cdata, raptor_xml_writer_cdata_counted): Pass
down xml_version.
(raptor_xml_writer_set_feature, raptor_xml_writer_get_feature):
Handle RAPTOR_FEATURE_WRITER_XML_VERSION.
* raptor/src/raptor_xml.c (raptor_xml_any_escape_string,
raptor_iostream_write_xml_any_escaped_string): Added, handling XML
1.0 or XML 1.1 Error if writing #x1-#x1f (excluding #x9, #xA, #xD)
or #x7F for XML 1.0
* raptor/src/raptor_serialize.c (raptor_serializer_set_feature,
redland/ChangeLog.6 view on Meta::CPAN
Deleted old and unused internal entity resolution code.
(raptor_libxml_init): send SAX2 events to core raptor_sax2_EVENT
routines.
* raptor/src/raptor_internal.h: Removed old and hardly tested
internal handling of libxml entities
* raptor/src/raptor_rdfxml.c: Rename raptor_xml_* to
raptor_rdfxml_* in structs and functions.
(raptor_rdfxml_start_element_handler,
raptor_rdfxml_end_element_handler, raptor_cdata_grammar): Move
expat BOM fixes to raptor_sax2.c
(raptor_rdfxml_parse_init): Use new raptor_sax2_set_EVENT_handler
methods. Use raptor_sax2_set_locator.
(raptor_get_libxml_context, raptor_set_libxml_document_locator,
raptor_get_libxml_document_locator, raptor_get_libxml_entities,
raptor_set_libxml_entities, raptor_expat_update_document_locator):
Deleted or merged into raptor_sax2.c
* raptor/src/raptor_parse.c
(raptor_parser_fatal_error_message_handler,
redland/ChangeLog.6 view on Meta::CPAN
* raptor/src/raptor_general.c (raptor_init, raptor_finish): Call
raptor_init_sax2 and raptor_finish_sax2 respectively.
* raptor/src/raptor_internal.h: Removed several libxml/expat/rdxml
functions used to be too friendly with internals of other classes.
Renamed raptor_xml_parser to raptor_rdfxml_parser. Updated
prototype of raptor_libxml_update_document_locator. Added new
parser handler prototypes raptor_parser_error_message_handler,
raptor_parser_fatal_error_message_handler and
raptor_parser_warning_message_handler Added handlers for SAX2
events - start element, end element, characters, cdata, comment,
unparsed_entity_decl, external_entity_ref named as
raptor_sax2_EVENT_handler. raptor_sax2 gains a magic field as
this is used as the user data for libxml. raptor_sax2 uses the
handler typedefs for the event handlers. raptor_sax2 gains erorr,
fatal and warning handler and data fields. Added prototypes for
raptor_init_sax2 and raptor_finish_sax2. Updated prototype for
raptor_new_sax2. Added prototypes for
raptor_sax2_set_start_element_handler,
raptor_sax2_set_end_element_handler,
raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler,
raptor_sax2_set_comment_handler,
raptor_sax2_set_unparsed_entity_decl_handler and
raptor_sax2_set_external_entity_ref_handler Added prototype for
raptor_sax2_set_locator. Added prototypes for:
raptor_sax2_start_element raptor_sax2_end_element,
raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment,
raptor_sax2_unparsed_entity_decl and
raptor_sax2_external_entity_ref.
* raptor/src/raptor_sax2.c: Now a more complete class
(raptor_init_sax2, raptor_finish_sax2): Added, calling any static
initialising/finishing.
(raptor_new_sax2): Added error, fatal_error and warning data and
handler registers. Register magic for libxml2 user_data fixups
(raptor_sax2_set_start_element_handler,
raptor_sax2_set_end_element_handler,
raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler,
raptor_sax2_set_comment_handler,
raptor_sax2_set_unparsed_entity_decl_handler,
raptor_sax2_set_external_entity_ref_handler): Added for setting
SAX2 callback handlers.
(raptor_sax2_set_locator): Added, to set SAX2 file locator.
(raptor_sax2_parse_chunk): Update for new handlers, remove all
mention of raptor_parser. Use this object (raptor_sax2*) as the
user data now, not an external raptor_parser*.
(raptor_sax2_update_document_locator): Added, updating the current
location for the internal parser.
(raptor_sax2_start_element): Added, internal function calling the
start element handler, adding various workarounds needed.
(raptor_sax2_end_element): Added, internal function calling the
end element handler, adding various workarounds needed.
(raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment,
raptor_sax2_unparsed_entity_decl,
raptor_sax2_external_entity_ref): Added, internal functions
calling the same-named handler.
2005-09-09 Dave Beckett <dave@dajobe.org>
* raptor/docs/raptor-sections.txt: Added new fns
* rasqal/docs/rasqal-sections.txt: No rasqal_variable_s
redland/ChangeLog.6 view on Meta::CPAN
expat-specific.
(raptor_xml_parse_init): Init sax2 handler fields
* raptor/src/raptor_libxml.c (raptor_libxml_init): Use sax2
structure handlers
* raptor/src/raptor_expat.c (raptor_expat_init): Use sax2
structure handlers
* raptor/src/raptor_internal.h: raptor_sax2 gains handlers for
start/end element, characters, cdata, comment, unparsed entity
declaration, extenal entity reference.
* rasqal/src/rasqal_query.c (rasqal_graph_pattern_visit): Make
this recursive.
* rasqal/tests/sparql/ExprBuiltins/Makefile.am: datatype-1 works
* rasqal/src/rasqal_expr.c (rasqal_expression_evaluate): For
datatype, if is a typed literal it has a datatype field then
return that, otherwise fail.
redland/raptor/ChangeLog view on Meta::CPAN
* src/raptor_internal.h: Declare many error/warning/*varargs
prototypes with RAPTOR_PRINTF_FORMAT that they take a printf-style
format argument.
* src/raptor.h: Added RAPTOR_PRINTF_FORMAT to allow declaring of
functions with a printf-style format argument.
Declare raptor_vsnprintf using it.
* src/raptor_internal.h, src/raptor_rdfxml.c, src/raptor_xml.c:
Turn content_cdata into using raptor_stringbuffer so that it does
a lot less copying (strncpy) when joining literals
2006-10-03 Dave Beckett <dave@dajobe.org>
* examples/Makefile.am: Fix AM_* flags
2006-10-02 Dave Beckett <dave@dajobe.org>
* docs/raptor-tutorial-serializing.xml: typo
raptor_serializer_set_namespace => raptor_serialize_set_namespace
redland/raptor/ChangeLog view on Meta::CPAN
state.
* src/raptor_xslt.c: (raptor_xslt_uri_parse_bytes,
raptor_xslt_run_grddl_transform_uri): Update to use array of
features.
* src/raptor_rdfxml.c: (raptor_rdfxml_start_element_handler,
raptor_rdfxml_parse_start, raptor_rdfxml_generate_statement,
raptor_rdfxml_process_property_attributes,
raptor_rdfxml_start_element_grammar,
raptor_rdfxml_end_element_grammar, raptor_rdfxml_cdata_grammar,
raptor_rdfxml_record_ID): Update to use array of features
throughout.
* src/raptor_rss.c: (raptor_rss_parse_start): Update to use array
of features.
* src/raptor_guess.c: (raptor_guess_parse_chunk): Use
raptor_parser_copy_user_state to copy over pointers and feature
flags to the inner parser.
redland/raptor/ChangeLog view on Meta::CPAN
* src/raptor_www_test.c: (main): Rewrite to remove warning punning
* src/raptor_uri.c: (raptor_uri_uri_string_to_filename_fragment):
Rewrite to remove warning punning
* src/raptor_serialize_rss.c: (raptor_rss10_emit_item): Init
element to NULL
* src/raptor_rss.c: (raptor_rss_end_element_handler): Init
cdata_len to 0
* configure.ac, src/win32_raptor_config.h: Bumped version to
1.4.10
* Snapshotted raptor_1_4_9 for 1.4.9 release
* src/raptor_rdfxml.c: (raptor_rdfxml_sax2_new_namespace_handler):
Move var def to start of block.
* src/raptor_parse.c: (raptor_parse_uri_with_connection): Move var
redland/raptor/ChangeLog view on Meta::CPAN
* src/raptor_serialize_rss.c: casts
* src/raptor_rss.c, src/raptor_rss.h, src/raptor_rss_common.c,
src/raptor_serialize_rss.c: Switch to using raptor_sax2 API from
xmlReader, and now can do atom type 'xhtml' content using
raptor_xml_writer.
* src/raptor.h: Add prototype for raptor_xml_element_is_empty
* src/raptor_rdfxml.c: (raptor_rdfxml_characters_handler,
raptor_rdfxml_cdata_handler, raptor_rdfxml_comment_handler): Add
xml_element parameter.
* src/raptor_sax2.c: (raptor_xml_element_is_empty): Added.
(raptor_sax2_characters_handler, raptor_sax2_cdata_handler,
raptor_sax2_comment_handler): Add xml_element parameter.
* src/raptor_internal.h: Add xml_element field to
raptor_sax2_characters_handler, raptor_sax2_cdata_handler and
raptor_sax2_comment_handler
2006-03-30 Dave Beckett <dave@dajobe.org>
* src/raptor_rdfxml.c: update function names in fatal/debug messages
* src/raptor_rdfxml.c: (raptor_rdfxml_start_element_handler): Tidy
tests for looking for an empty element.
* src/raptor_internal.h: raptor_xml_element gains a user_data
redland/raptor/ChangeLog view on Meta::CPAN
error/warning/fatal error handlers with varargs, just given a
handler that takes a single message string.
2006-02-03 Dave Beckett <dave@dajobe.org>
* configure.ac: allow --enable-parsers/serializers=none
2006-02-02 Dave Beckett <dave@dajobe.org>
* src/raptor_rss.c: (raptor_rss_start_element,
raptor_rss_end_element, raptor_rss_cdata):
Added, pulling big chunks of code out of the switch in
raptor_rss_parser_processNode.
2006-01-27 Dave Beckett <dave@dajobe.org>
* src/raptor_serialize_rss.c: Do not write XML header here, XML
writer does it.
2006-01-22 Dave Beckett <dave@dajobe.org>
redland/raptor/ChangeLog view on Meta::CPAN
* src/raptor_serialize_rdfxml.c (raptor_rdfxml_serialize_start):
Pass down xml_version to the raptor_xml_writer and write the
versioned header.
* src/raptor_xml_writer.c: Add xml_version to raptor_xml_writer
structure.
(raptor_iostream_write_xml_element_start): Add xml_version field
and pass it down to the XML escape function.
(raptor_new_xml_writer): Init xml_version to 10.
(raptor_xml_writer_empty_element, raptor_xml_writer_start_element,
raptor_xml_writer_cdata, raptor_xml_writer_cdata_counted): Pass
down xml_version.
(raptor_xml_writer_set_feature, raptor_xml_writer_get_feature):
Handle RAPTOR_FEATURE_WRITER_XML_VERSION.
* src/raptor_xml.c (raptor_xml_any_escape_string,
raptor_iostream_write_xml_any_escaped_string): Added, handling XML
1.0 or XML 1.1 Error if writing #x1-#x1f (excluding #x9, #xA, #xD)
or #x7F for XML 1.0
* src/raptor_serialize.c (raptor_serializer_set_feature,
redland/raptor/ChangeLog view on Meta::CPAN
Deleted old and unused internal entity resolution code.
(raptor_libxml_init): send SAX2 events to core raptor_sax2_EVENT
routines.
* src/raptor_internal.h: Removed old and hardly tested internal
handling of libxml entities
* src/raptor_rdfxml.c: Rename raptor_xml_* to raptor_rdfxml_* in
structs and functions.
(raptor_rdfxml_start_element_handler,
raptor_rdfxml_end_element_handler, raptor_cdata_grammar): Move
expat BOM fixes to raptor_sax2.c
(raptor_rdfxml_parse_init): Use new raptor_sax2_set_EVENT_handler
methods. Use raptor_sax2_set_locator.
(raptor_get_libxml_context, raptor_set_libxml_document_locator,
raptor_get_libxml_document_locator, raptor_get_libxml_entities,
raptor_set_libxml_entities, raptor_expat_update_document_locator):
Deleted or merged into raptor_sax2.c
* src/raptor_parse.c (raptor_parser_fatal_error_message_handler,
raptor_parser_error_message_handler,
redland/raptor/ChangeLog view on Meta::CPAN
* src/raptor_general.c (raptor_init, raptor_finish): Call
raptor_init_sax2 and raptor_finish_sax2 respectively.
* src/raptor_internal.h: Removed several libxml/expat/rdxml
functions used to be too friendly with internals of other classes.
Renamed raptor_xml_parser to raptor_rdfxml_parser. Updated
prototype of raptor_libxml_update_document_locator. Added new
parser handler prototypes raptor_parser_error_message_handler,
raptor_parser_fatal_error_message_handler and
raptor_parser_warning_message_handler Added handlers for SAX2
events - start element, end element, characters, cdata, comment,
unparsed_entity_decl, external_entity_ref named as
raptor_sax2_EVENT_handler. raptor_sax2 gains a magic field as
this is used as the user data for libxml. raptor_sax2 uses the
handler typedefs for the event handlers. raptor_sax2 gains erorr,
fatal and warning handler and data fields. Added prototypes for
raptor_init_sax2 and raptor_finish_sax2. Updated prototype for
raptor_new_sax2. Added prototypes for
raptor_sax2_set_start_element_handler,
raptor_sax2_set_end_element_handler,
raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler,
raptor_sax2_set_comment_handler,
raptor_sax2_set_unparsed_entity_decl_handler and
raptor_sax2_set_external_entity_ref_handler Added prototype for
raptor_sax2_set_locator. Added prototypes for:
raptor_sax2_start_element raptor_sax2_end_element,
raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment,
raptor_sax2_unparsed_entity_decl and
raptor_sax2_external_entity_ref.
* src/raptor_sax2.c: Now a more complete class
(raptor_init_sax2, raptor_finish_sax2): Added, calling any static
initialising/finishing.
(raptor_new_sax2): Added error, fatal_error and warning data and
handler registers. Register magic for libxml2 user_data fixups
(raptor_sax2_set_start_element_handler,
raptor_sax2_set_end_element_handler,
raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler,
raptor_sax2_set_comment_handler,
raptor_sax2_set_unparsed_entity_decl_handler,
raptor_sax2_set_external_entity_ref_handler): Added for setting
SAX2 callback handlers.
(raptor_sax2_set_locator): Added, to set SAX2 file locator.
(raptor_sax2_parse_chunk): Update for new handlers, remove all
mention of raptor_parser. Use this object (raptor_sax2*) as the
user data now, not an external raptor_parser*.
(raptor_sax2_update_document_locator): Added, updating the current
location for the internal parser.
(raptor_sax2_start_element): Added, internal function calling the
start element handler, adding various workarounds needed.
(raptor_sax2_end_element): Added, internal function calling the
end element handler, adding various workarounds needed.
(raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment,
raptor_sax2_unparsed_entity_decl,
raptor_sax2_external_entity_ref): Added, internal functions
calling the same-named handler.
2005-09-09 Dave Beckett
* src/raptor_qname.c: autodocs
* docs/raptor-sections.txt: Added new functions.
redland/raptor/ChangeLog view on Meta::CPAN
expat-specific.
(raptor_xml_parse_init): Init sax2 handler fields
* src/raptor_libxml.c (raptor_libxml_init): Use sax2 structure
handlers
* src/raptor_expat.c (raptor_expat_init): Use sax2 structure
handlers
* src/raptor_internal.h: raptor_sax2 gains handlers for start/end
element, characters, cdata, comment, unparsed entity declaration,
extenal entity reference.
* src/raptor_sax2.c (raptor_sax2_parse_start): Init expat and
libxml the same
* src/raptor_libxml.c (raptor_libxml_init): Take raptor_sax2* and
raptor_uri* args
* src/raptor_expat.c (raptor_expat_init): Take raptor_sax2* and
raptor_uri* args
redland/raptor/ChangeLog.3 view on Meta::CPAN
* tests/Makefile.am: Added ex-42
* tests/ex-42.out, tests/ex-42.rdf: rdf:bagID
* tests/bad-04.rdf: Check rdf:ID and rdf:bagID with same value fails
* tests/bad-02.rdf: Duplicate rdf:ID names
* raptor_parse.c:
Make debug less chatty about cdata, unless RAPTOR_DEBUG_CDATA
defined.
* raptor_parse.c (raptor_record_ID):
Added, notes rdf:ID and rdf:bagID values, checks
for duplicates (per in-scope base-URI).
(raptor_free_ID_list): Added, frees structure above.
(raptor_xml_start_element_handler): Handle xml:base using
raptor_new_uri_for_xmlbase to strip/fix parts that aren't used.
(raptor_start_element_grammar): Check for illegal rdf:ID, rdf:bagID
and rdf:nodeID using raptor_valid_xml_ID. Check for duplicate rdf:ID
redland/raptor/ChangeLog.3 view on Meta::CPAN
2002-09-19 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* Makefile.am:
Restore rule to make librdf.la for when embedded in Redland
* TODO.html: remove duplicate bagID bug
* TODO.html: CDATA works with libxml now
* raptor_libxml.c (raptor_libxml_init):
Enable handling of cdata blocks -
<![CDATA[...]> by registering callback to raptor_xml_cdata_handler
* tests/ex-40.out: Fix node
* tests/Makefile.am: Added ex-40
* tests/ex-40.out, tests/ex-40.rdf: Check XML CDATA sections
* Makefile.am:
dist-hook added to copy pre-built README and NEWS to release
redland/raptor/ChangeLog.3 view on Meta::CPAN
* raptor_internal.h: Export raptor_libxml_update_document_locator
Export raptor_expat_update_document_locator
Export raptor_update_document_locator
* raptor_libxml.c (raptor_libxml_update_document_locator):
Now not static.
Remove column numbers - they seem to be total fiction.
* raptor_locator.c (raptor_update_document_locator): Added.
* raptor_parse.c (raptor_xml_cdata_handler):
Allow to be ignored when there is no
element (XML very damaged)
* rdfdump.c: Tidy output formatting
* raptor_libxml.c:
Delete extra '\n' at end of XML parsing messages; that's up to the
app to add.
* raptor_parse.c: Removed some \n-s from warning/error messages
redland/raptor/ChangeLog.3 view on Meta::CPAN
Don't pop element before doing end
grammar, so that rdf_parser->current_element is correct during end
grammar work.
* raptor_parse.c, ntriples_parse.c:
Include stdlib.h for some prototypes.
2002-05-28 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_parse.c (raptor_end_element_grammar):
When zapping content_cdata, always make
length 0
2002-05-26 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* tests/ex-28.out, tests/ex-28.rdf:
Test case for property after parseType resource property inherting
parseType resource-ness
* tests/Makefile.am: Added test case 28
redland/raptor/ChangeLog.3 view on Meta::CPAN
Removed old block_type comment
* raptor_parse.c:
Remove IN_RDF reference
* raptor_parse.c:
Change content_type / child_content_type when the state /
child_state is set
Change content_type when parseType changes.
* raptor_parse.c (raptor_xml_cdata_handler):
Changed to handle a few state exceptions
and then work on a content_type basis.
When reading a property value, if non-whitespace content is found,
set the content type to be literal.
* raptor_parse.c (raptor_xml_end_element_handler):
If there is a parent, pass the last
state of this element back up.
* raptor_parse.c (raptor_xml_start_element_handler):
redland/raptor/ChangeLog.4 view on Meta::CPAN
* libraptor.3: bump date
* raptor_stringbuffer.c (main): Do not free as_string returned strings
* raptor_stringbuffer.c: brackets
* raptor_stringbuffer.c (raptor_free_stringbuffer):
Free any constructed string.
* raptor_xml_writer.c:
Use raptor_stringbuffer to better grow the output cdata.
* raptor_stringbuffer.c: stringbuffer now uses unsigned char
Removed raptor_new|free_stringbuffer_node - used once, now inlined.
(raptor_stringbuffer_append_string_common): Added with
common append code merged here.
(raptor_stringbuffer_append_counted_string,
raptor_stringbuffer_append_string): Added do_copy arg.
(main): Test code updated for api changes.
* raptor_internal.h:
redland/raptor/ChangeLog.4 view on Meta::CPAN
* Makefile.am: Remove maintainer only n3 lex/yacc rules (flex/bison)
Post process the bison output to remove unused label to make g++
happier.
* raptor_internal.h:
Added raptor_xml_literal_datatype_uri_string for the RDF datatype
literal URI string, used several times.
raptor_check_ordinal takes unsigned char*
A couple of lengths, counts become unsigned int.
raptor_unicode_char_to_utf8, raptor_format_sax2_element,
raptor_xml_writer_cdata, raptor_xml_writer_comment,
raptor_xml_writer_as_string changed to
take/return unsigned char* for UTF8 strings.
* raptor.h: raptor_new_uri_func, raptor_new_uri_from_local_name_func,
raptor_new_uri_relative_to_base_func, raptor_uri_as_string_func,
raptor_uri_as_counted_string_func URI factory methods
changed to all take/return unsigned char* for URI strings
raptor_statement_part_as_counted_string,
raptor_statement_part_as_string,
raptor_new_uri, raptor_new_uri_from_uri_local_name,
redland/raptor/ChangeLog.4 view on Meta::CPAN
* TODO.html: ntriples parser should use raptor_generate_id for bnodes
2003-12-01 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_set.c (raptor_set_stats_print): Debug printing tweak.
2003-11-28 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_internal.h: raptor_check_ordinal with now unsigned char* arg
raptor_sax2 content_cdata now unsigned char*
* raptor_general.c (raptor_check_ordinal): unsigned char *name
* raptor_parse.c: Lots of char/unsigned char casting.
* n3_common.h: Undo n3_syntax_error back to raptor_parser arg.
* n3_parser.y: (n3_parser_error) aka yyerror; take a void arg.
* n3_common.h:
redland/raptor/ChangeLog.4 view on Meta::CPAN
* Makefile.am:
Added raptor_stringbuffer.c raptor_stringbuffer_test code
* raptor.h: Added raptor_stringbuffer.
* raptor_stringbuffer.c: Stringbuffer class for growing strings
* raptor_libxml.c (raptor_libxml_init): With libxml2 use
raptor_xml_characters_handler for sax->characters.
* raptor_parse.c (raptor_cdata_grammar): Added is_cdata arg.
(raptor_xml_characters_handler): Added, calling raptor_cdata_grammar.
(raptor_xml_cdata_handler): Updated to call raptor_cdata_grammar with
is_cdata=1.
(raptor_xml_parse_init): With expat use raptor_xml_characters_handler
with XML_SetCharacterDataHandler.
(raptor_cdata_grammar): Tidy error reporting; do not use
raptor_xml_writer_as_string for a simple print.
* raptor_internal.h: Added raptor_xml_characters_handler prototype.
2003-11-25 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* manifest.pl: Add withdrawn tests check
2003-11-23 Dave Beckett <Dave.Beckett@bristol.ac.uk>
redland/raptor/ChangeLog.4 view on Meta::CPAN
URI string pointer. For rdf:ID, do not allocate the URI twice.
* raptor_parse.c (raptor_generate_statement):
Do not set language when a datatype is given.
* raptor_xml_writer.c (raptor_new_xml_writer):
Initialise writer buffer to an empty string
to start (i.e. just \0).
(raptor_xml_writer_start_element): Now assume buffer is always
present, remove empty buffer case.
(raptor_xml_writer_end_element,raptor_xml_writer_cdata): Handle 0
length case, no strncpy.
* tests/Makefile.am: Added ex-51.
Fix daml+oil test.
* tests/ex-51.out, tests/ex-51.rdf: Check empty XML literal works
* tests/ex-41.out: No language for datatyped literals.
* tests/daml-oil.rdf, tests/daml-oil.out, tests/Makefile.am:
redland/raptor/ChangeLog.4 view on Meta::CPAN
which isn't always available.
2003-08-20 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_general.c (raptor_check_ordinal): parentheses just for gcc
2003-08-17 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_xml_writer.c:
(raptor_xml_writer_end_element) Reset the current_element pointer
on finishing. Makes any succeeding cdata do the right thing.
* rdfdump.c: Inside redland, don't call raptor_init/finish, it's
done by redland's world.
2003-08-13 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_rss.c (raptor_rss_parse_chunk):
Stop working after a user abort of the parser.
* raptor_general.c (raptor_check_ordinal): c is not const
redland/raptor/ChangeLog.4 view on Meta::CPAN
* TODO.html: NFC checking done.
Exclusive XML C14N done.
* raptor_namespace.c (raptor_namespace_copy):
Don't copy uri and then lose it.
* raptor_xml_writer.c:
Added current_element for tracking empty/not empty elements.
(raptor_xml_writer_comment): Added, just concatenating the content
via raptor_xml_writer_cdata.
* raptor_parse.c (raptor_xml_comment_handler):
Call raptor_xml_writer_comment inside
parseType="Literal"
* raptor_xml_writer.c: raptor_xml_writer gains stack depth.
(raptor_free_xml_writer): Clear any content_cdata before finishing.
(raptor_xml_writer_start_element)
Add depth to raptor_format_sax2_element calls. Increase it
(raptor_xml_writer_start_element,raptor_xml_writer_end_element):
Add depth to raptor_format_sax2_element calls. Decrease it
and raptor_namespaces_end_for_depth each time.
* raptor_namespace.c:
Moved error_handler and error_data arguments around.
(raptor_namespaces_start_namespace) Gets those as arguments
(raptor_namespaces_start_namespace) Added, simpler version of _full
redland/raptor/ChangeLog.4 view on Meta::CPAN
present.
copy namespaces to new stack when new ones are needed.
* raptor_internal.h:
Add error_handler and error_data to namespace_stack.
raptor_namespaces_start_namespace gets those as arguments
raptor_namespace_new looses them
raptor_namespaces_start_namespace takes less args
raptor_namespaces_start_namespace_full added
raptor_namespace_copy added
content_cdata_seen and content_element_seen back into sax2_element
* raptor_parse.c:
Moved content_cdata_seen and content_element_seen back into sax2_element
Update for new raptor_namespaces_start_namespace calling convention.
* raptor_xml_writer.c: Debug
* raptor_namespace.c (raptor_namespaces_format):
Fix missing counting : when present
* tests/ex-11.rdf, tests/ex-11.out:
Updated to declare the html namespace as default, expect it in the
N-Triples output.
redland/raptor/ChangeLog.4 view on Meta::CPAN
Added prototypes for raptor_namespaces_namespace_in_scope,
raptor_namespaces_format
raptor_format_sax2_element now takes a raptor_namespace_stack
2003-07-27 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_internal.h: raptor_xml_writer prototypes take unsigned char*
* raptor_parse.c: Move the code building parseType="Literal" strings to
raptor_xml_writer class.
(raptor_cdata_grammar): Added, just for symmetry mostly, with most
code taken from raptor_xml_cdata_handler.
* raptor_xml_writer.c:
Move the code building parseType="Literal" strings to
raptor_xml_writer class.
* Makefile.am: Added raptor_xml_writer.c
* raptor_xml_writer.c: Initial version
* raptor_parse.c:
Split content_cdata fields between sax2_element & (RDF/XML
specific) element.
raptor_element: Add xml_writer field.
Various calls changed to use the new raptor_simple_message_handler
for error handling implemented as raptor_parser_simple_error here.
(raptor_xml_parser_simple_error_handler): Added, matching the
raptor_simple_message_handler API and calling raptor_parser_error.
(raptor_start_element_grammar): When parseType="Literal" appears,
create a new raptor_xml_writer.
(raptor_end_element_grammar): When parseType="Literal" ends, delete
the raptor_xml_writer.
redland/raptor/ChangeLog.4 view on Meta::CPAN
Re-ordered URI functions earlier.
Various methods changed to use (public) raptor_simple_message_handler
for error handling.
* raptor_internal.h: Delete raptor_internal_message_handler.
Added prototype raptor_parser_simple_error, implementing
raptor_simple_error_handler API.
Various methods changed to use (public) raptor_simple_message_handler
for error handling.
raptor_sax2_element moved to semi-public raptor.h
rdf/xml-specific cdata parts moved from raptor_sax2_element to
raptor_element.
Added raptor_xml_writer functions.
* raptor_namespace.c:
Use (public) raptor_simple_message_handler for error handling.
2003-07-24 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_parse.c (raptor_process_property_attributes):
NFC error message tidy.
redland/raptor/ChangeLog.4 view on Meta::CPAN
Checking escaping in parseType Literal values with XML attributes
* raptor_parse.c (raptor_format_element):
Pass in parser for UTF-8 error handling.
Use raptor_xml_escape_string for attribute values but
only malloc/free if lengths changed.
(raptor_xml_end_element_handler): Update to new
raptor_xml_escape_string API and only malloc/free it if lengths
changed.
* raptor_parse.c (raptor_xml_cdata_handler):
Use updated raptor_xml_escape_string API
* raptor.h: Added raptor_statement_part_as_counted_string,
raptor_statement_part_as_string
Changed raptor_xml_escape_string API
* raptor_general.c (raptor_statement_part_as_counted_string,
raptor_statement_part_as_string): Added, making N-triples style
output from parts of raptor_statement.
(raptor_xml_escape_string): Change API to take an existing
redland/raptor/ChangeLog.4 view on Meta::CPAN
* libraptor.3: raptor_parse_chunk: Takes unsigned char buffer.
* libraptor.3: raptor_start_parse: Note NULL base URI ok for ntriples
* libraptor.3: Typo: raptor_start_parse not raptor_parse_start
* raptor_general.c (raptor_xml_escape_string):
Make it work with 10ffff again
* raptor_parse.c (raptor_xml_cdata_handler):
Cast around raptor_xml_escape_string
* raptor_general.c (raptor_xml_escape_string):
Null terminate new string
* raptor_www_libxml.c, raptor_www.c:
Use RAPTOR_WWW_BUFFER_SIZE for I/O buffers
* raptor_internal.h: Define RAPTOR_WWW_BUFFER_SIZE for I/O buffers
redland/raptor/ChangeLog.4 view on Meta::CPAN
raptor_xml_parser_stats_print, raptor_set_stats_print: Defined with
RAPTOR_DEBUG
* raptor_parse.c (raptor_xml_parser_stats_print):
Defined with RAPTOR_DEBUG
* raptor_general.c (raptor_stats_print): Defined with RAPTOR_DEBUG
* TODO.html: Fixed escaping rdf:parseType="Literal" content
* raptor_parse.c (raptor_xml_cdata_handler):
Use raptor_xml_escape_string when content
type is an XML literal
* raptor_general.c (raptor_xml_escape_string):
Now takes and returns lengths
Fix assumption of '\0' terminated strings.
(main): Update for counted strings
* raptor.h: raptor_xml_escape_string now takes and returns lengths
redland/raptor/ChangeLog.5 view on Meta::CPAN
raptor_rss10_build_xml_names
Move bits around so that rdf:RDF is declared with all namespaces
known and using raptor_xml_writer_start_element.
Emit rdf:Seq and rdf:li elements using_xml_writer_start_element with
attributes as needed.
Attempt to emit channel items.
* raptor_internal.h: Remove
raptor_xml_writer_element_declare_namespace_full
* raptor_xml_writer.c: Renamed content_cdata_namespaces to nstack,
content_cdata_namespaces_depth to nstack_depth.
(raptor_xml_writer_start_namespace_full): Added, to start a new
namespace in the xml_writer at the current element.
(raptor_xml_writer_cdata_counted, raptor_xml_writer_raw_counted,
raptor_xml_writer_comment_counted): Added.counted string versions.
* raptor_sax2.c (raptor_new_sax2_element, raptor_free_sax2_element):
Init/tidy declared_namespaces.
(raptor_sax2_declare_namespace): Added to declare the given namespace
on the element.
(raptor_iostream_write_sax2_element): Handle declared_namespaces;
boost the nspace_declarations by size of the sequence.
Declare all the namespaces in the declared_nspaces sequence.
* raptor_rdfxml.c (raptor_xml_comment_handler):
Use raptor_xml_writer_comment (uncounted).
(raptor_cdata_grammar): Use raptor_xml_writer_cdata_counted
* raptor_internal.h: raptor_sax2_element added declared_nspaces field
Added prototype for raptor_sax2_declare_namespace.
Added prototypes for raptor_xml_writer_start_namespace_full and
raptor_xml_writer_element_declare_namespace_full
Split raptor_xml_writer_cdata / raptor_xml_writer_raw /
raptor_xml_writer_comment into uncounted and
raptor_xml_writer_cdata_counted / raw_counted / comment_counted
2004-12-21 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_rss.c: Made rss1.0 the default namespace for writing;
added prefixes for others.
(raptor_rss10_serialize_end): Removed unused commented code.
* raptor_qname.c (raptor_qname_copy): Added.
* raptor.h: Added raptor_qname_copy.
redland/raptor/ChangeLog.5 view on Meta::CPAN
* raptor_qname.c (raptor_iostream_write_qname):
Added to write a qname to an iostream.
* raptor.h: Add prototypes for raptor_iostream_write_qname,
raptor_new_namespace_from_uri
* raptor_rdfxml.c (raptor_xml_start_element_handler,
raptor_xml_end_element_handler, raptor_xml_comment_handler,
raptor_start_element_grammar, raptor_end_element_grammar,
raptor_cdata_grammar): Update the use of xml_writer for building
parseType="Literal" content to use an iostream. Use more sax2
methods rather than direct access to internals - still some left.
(raptor_xml_parse_init, raptor_xml_parse_start,
raptor_xml_parse_terminate, raptor_inscope_xml_language,
raptor_inscope_base_uri): Move expat/libxml details to
raptor_new_sax2, raptor_sax2_parse_start, raptor_free_sax2,
raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri
respectively.
(raptor_xml_parse_chunk_): Deleted, moved to raptor_sax2_parse_chunk
* raptor_xml_writer.c: Change to output to an iostream not build
up a stringbuffer.
(raptor_new_xml_writer): Add iostream arg, delete never-used
canonicalize.
(raptor_free_xml_writer): Remove stringbuffer.
(raptor_xml_writer_start_element, raptor_xml_writer_end_element):
Delete stringbuffer and use raptor_iostream_write_sax2_element.
(raptor_xml_writer_cdata): Delete stringbuffer and use
raptor_iostream_write_xml_escaped_string.
(raptor_xml_writer_raw): Added to write just the bytes.
(raptor_xml_writer_comment): Fixed to emit <!-- and -->
(raptor_xml_writer_as_string): Deleted.
(main): Added with test case.
* raptor_sax2.c (raptor_new_sax2, raptor_free_sax2,
raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri,
raptor_sax2_get_depth, raptor_sax2_inc_depth,
raptor_sax2_dec_depth, raptor_sax2_parse_start,
redland/raptor/ChangeLog.5 view on Meta::CPAN
Use xmlTextReaderLocalName, xmlTextReaderNamespaceUri instead of the
Const versions with additional corresponding xmlFree()s for <2.6.0
2004-11-01 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* Snapshotted raptor_1_4_2 for 1.4.2 release
* win32_raptor_config.h, configure.ac:
Bumped version to 1.4.2
* raptor_xml_writer.c (raptor_xml_writer_cdata):
Return when raptor_xml_escape_string fails.
* raptor_xml.c (raptor_xml_escape_string):
Return -1 on UTF-8 encoding failure
* raptor_xml.c: docs
2004-10-28 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* Snapshotted raptor_1_4_1 for 1.4.1 release
* raptor_xml.c (raptor_xml_escape_string): Ensure an empty string
is copied out; write a NUL.
2004-10-28 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* libraptor.3: 1.4.1 raptor_xml_escape_string return value now
int, <0 on failure.
* raptor_xml_writer.c (raptor_xml_writer_cdata): Use int for
raptor_xml_escape_string return variables and use error return <0
* raptor_serialize.c: (raptor_rdfxml_serialize_write_xml_attribute,
raptor_rdfxml_serialize_statement) Use int for
raptor_xml_escape_string return variables. Handle empty string
attribute when len=0.
* raptor_sax2.c (raptor_format_sax2_element):
Use int for raptor_xml_escape_string return.
redland/raptor/ChangeLog.5 view on Meta::CPAN
* raptor.rdf.in: Add Raptor to the desc
* raptor.rdf.in, raptor.spec.in:
Update descriptions to include serializers
2004-10-21 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_namespace.c: less namespace debugs
* raptor_xml_writer.c: less cdata debugs
* raptor_namespace.c: Make most namespace debug messages appear
only if #ifdef RAPTOR_DEBUG_VERBOSE
* raptor_rdfxml.c: Make most rdf/xml parsing debug messages appear
only if #ifdef RAPTOR_DEBUG_VERBOSE
* raptor_serialize.c:
(raptor_serialize_start, raptor_serialize_start_to_filename,
raptor_serialize_start_to_string,
redland/raptor/ChangeLog.5 view on Meta::CPAN
2004-04-15 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_general.c (raptor_guess_parser_name):
use strrchr to find *last* .
2004-04-14 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* raptor_sequence.c (raptor_new_sequence): Zap sequence field.
* raptor_xml_writer.c (raptor_xml_writer_cdata):
Do not copy more bytes than allowed.
* Makefile.am: Added raptor_expat.c
* raptor_parse.c: Export some expat-only handlers:
raptor_xml_unparsed_entity_decl_handler,
raptor_xml_external_entity_ref_handler.
(raptor_xml_parse_init): Do not call expat init code here.
(raptor_xml_parse_start): Call new raptor_expat_init to initialise
parser state.
redland/raptor/RELEASE.html view on Meta::CPAN
<a href="http://librdf.org/rasqal/">Rasqal</a> to provide serializing
of query results to XML.
</p>
<p>The new <code>raptor_xml_writer</code> class functions added are:
<code>raptor_new_xml_writer</code> (constructor),
<code>raptor_free_xml_writer</code> (destructor),
<code>raptor_xml_writer_empty_element</code>,
<code>raptor_xml_writer_start_element</code>,
<code>raptor_xml_writer_end_element</code>,
<code>raptor_xml_writer_cdata</code>,
<code>raptor_xml_writer_cdata_counted</code>,
<code>raptor_xml_writer_raw</code>,
<code>raptor_xml_writer_raw_counted</code>,
<code>raptor_xml_writer_comment</code> and
<code>raptor_xml_writer_comment_counted</code>.
</p>
<p>The new <code>raptor_xml_element</code> class functions added are:
<code>raptor_new_xml_element</code> (constructor),
<code>raptor_free_xml_element</code> (destructor),
<code>raptor_xml_element_get_name</code>,
redland/raptor/docs/html/index.sgml view on Meta::CPAN
<ANCHOR id="raptor-xml-element-get-attributes" href="raptor/raptor-section-xml.html#raptor-xml-element-get-attributes">
<ANCHOR id="raptor-xml-element-get-attributes-count" href="raptor/raptor-section-xml.html#raptor-xml-element-get-attributes-count">
<ANCHOR id="raptor-xml-element-set-attributes" href="raptor/raptor-section-xml.html#raptor-xml-element-set-attributes">
<ANCHOR id="raptor-xml-element-declare-namespace" href="raptor/raptor-section-xml.html#raptor-xml-element-declare-namespace">
<ANCHOR id="raptor-xml-element-is-empty" href="raptor/raptor-section-xml.html#raptor-xml-element-is-empty">
<ANCHOR id="raptor-new-xml-writer" href="raptor/raptor-section-xml.html#raptor-new-xml-writer">
<ANCHOR id="raptor-free-xml-writer" href="raptor/raptor-section-xml.html#raptor-free-xml-writer">
<ANCHOR id="raptor-xml-writer-empty-element" href="raptor/raptor-section-xml.html#raptor-xml-writer-empty-element">
<ANCHOR id="raptor-xml-writer-start-element" href="raptor/raptor-section-xml.html#raptor-xml-writer-start-element">
<ANCHOR id="raptor-xml-writer-end-element" href="raptor/raptor-section-xml.html#raptor-xml-writer-end-element">
<ANCHOR id="raptor-xml-writer-cdata" href="raptor/raptor-section-xml.html#raptor-xml-writer-cdata">
<ANCHOR id="raptor-xml-writer-cdata-counted" href="raptor/raptor-section-xml.html#raptor-xml-writer-cdata-counted">
<ANCHOR id="raptor-xml-writer-raw" href="raptor/raptor-section-xml.html#raptor-xml-writer-raw">
<ANCHOR id="raptor-xml-writer-raw-counted" href="raptor/raptor-section-xml.html#raptor-xml-writer-raw-counted">
<ANCHOR id="raptor-xml-writer-comment" href="raptor/raptor-section-xml.html#raptor-xml-writer-comment">
<ANCHOR id="raptor-xml-writer-comment-counted" href="raptor/raptor-section-xml.html#raptor-xml-writer-comment-counted">
<ANCHOR id="raptor-xml-writer-features-enumerate" href="raptor/raptor-section-xml.html#raptor-xml-writer-features-enumerate">
<ANCHOR id="raptor-xml-writer-set-feature" href="raptor/raptor-section-xml.html#raptor-xml-writer-set-feature">
<ANCHOR id="raptor-xml-writer-set-feature-string" href="raptor/raptor-section-xml.html#raptor-xml-writer-set-feature-string">
<ANCHOR id="raptor-xml-writer-get-feature" href="raptor/raptor-section-xml.html#raptor-xml-writer-get-feature">
<ANCHOR id="raptor-xml-writer-get-feature-string" href="raptor/raptor-section-xml.html#raptor-xml-writer-get-feature-string">
<ANCHOR id="raptor-iostream-write-xml-element" href="raptor/raptor-section-xml.html#raptor-iostream-write-xml-element">
redland/raptor/docs/html/ix01.html view on Meta::CPAN
<dt>raptor_xml_element_set_attributes, <a href="raptor-section-xml.html#id2648375">raptor_xml_element_set_attributes ()</a>
</dt>
<dt>raptor_xml_escape_string, <a href="raptor-section-xml.html#id2650974">raptor_xml_escape_string ()</a>
</dt>
<dt>raptor_xml_literal_datatype_uri_string_len, <a href="raptor-section-constants.html#id2591853">raptor_xml_literal_datatype_uri_string_len</a>
</dt>
<dt>raptor_xml_name_check, <a href="raptor-section-xml.html#id2651587">raptor_xml_name_check ()</a>
</dt>
<dt>raptor_xml_writer, <a href="raptor-section-xml.html#id2650564">raptor_xml_writer</a>
</dt>
<dt>raptor_xml_writer_cdata, <a href="raptor-section-xml.html#id2649198">raptor_xml_writer_cdata ()</a>
</dt>
<dt>raptor_xml_writer_cdata_counted, <a href="raptor-section-xml.html#id2649286">raptor_xml_writer_cdata_counted ()</a>
</dt>
<dt>raptor_xml_writer_comment, <a href="raptor-section-xml.html#id2649545">raptor_xml_writer_comment ()</a>
</dt>
<dt>raptor_xml_writer_comment_counted, <a href="raptor-section-xml.html#id2649624">raptor_xml_writer_comment_counted ()</a>
</dt>
<dt>raptor_xml_writer_empty_element, <a href="raptor-section-xml.html#id2648923">raptor_xml_writer_empty_element ()</a>
</dt>
<dt>raptor_xml_writer_end_element, <a href="raptor-section-xml.html#id2649108">raptor_xml_writer_end_element ()</a>
</dt>
<dt>raptor_xml_writer_features_enumerate, <a href="raptor-section-xml.html#id2649726">raptor_xml_writer_features_enumerate ()</a>
redland/raptor/docs/html/raptor-section-xml.html view on Meta::CPAN
<a href="raptor-section-general.html#raptor-simple-message-handler">raptor_simple_message_handler</a> error_handler,
void *error_data,
int canonicalize);
void <a href="raptor-section-xml.html#raptor-free-xml-writer">raptor_free_xml_writer</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer);
void <a href="raptor-section-xml.html#raptor-xml-writer-empty-element">raptor_xml_writer_empty_element</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
<a href="raptor-section-xml.html#raptor-xml-element">raptor_xml_element</a> *element);
void <a href="raptor-section-xml.html#raptor-xml-writer-start-element">raptor_xml_writer_start_element</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
<a href="raptor-section-xml.html#raptor-xml-element">raptor_xml_element</a> *element);
void <a href="raptor-section-xml.html#raptor-xml-writer-end-element">raptor_xml_writer_end_element</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
<a href="raptor-section-xml.html#raptor-xml-element">raptor_xml_element</a> *element);
void <a href="raptor-section-xml.html#raptor-xml-writer-cdata">raptor_xml_writer_cdata</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s);
void <a href="raptor-section-xml.html#raptor-xml-writer-cdata-counted">raptor_xml_writer_cdata_counted</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s,
unsigned int len);
void <a href="raptor-section-xml.html#raptor-xml-writer-raw">raptor_xml_writer_raw</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s);
void <a href="raptor-section-xml.html#raptor-xml-writer-raw-counted">raptor_xml_writer_raw_counted</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s,
unsigned int len);
void <a href="raptor-section-xml.html#raptor-xml-writer-comment">raptor_xml_writer_comment</a> (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s);
void <a href="raptor-section-xml.html#raptor-xml-writer-comment-counted">raptor_xml_writer_comment_counted</a>
redland/raptor/docs/html/raptor-section-xml.html view on Meta::CPAN
<td><span class="term"><em class="parameter"><code>element</code></em> :</span></td>
<td> XML element object
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2649198"></a><h3>
<a name="raptor-xml-writer-cdata"></a>raptor_xml_writer_cdata ()</h3>
<a class="indexterm" name="id2649209"></a><pre class="programlisting">void raptor_xml_writer_cdata (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s);</pre>
<p>
Write CDATA XML-escaped to the XML writer.
</p>
<p>
Closes any previous empty element if XML writer feature AUTO_EMPTY
is enabled.</p>
<p>
</p>
redland/raptor/docs/html/raptor-section-xml.html view on Meta::CPAN
<td><span class="term"><em class="parameter"><code>s</code></em> :</span></td>
<td> string to XML escape and write
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2649286"></a><h3>
<a name="raptor-xml-writer-cdata-counted"></a>raptor_xml_writer_cdata_counted ()</h3>
<a class="indexterm" name="id2649299"></a><pre class="programlisting">void raptor_xml_writer_cdata_counted (<a href="raptor-section-xml.html#raptor-xml-writer">raptor_xml_writer</a> *xml_writer,
unsigned char *s,
unsigned int len);</pre>
<p>
Write counted CDATA XML-escaped to the XML writer.
</p>
<p>
Closes any previous empty element if XML writer feature AUTO_EMPTY
is enabled.</p>
<p>
redland/raptor/docs/html/raptor.devhelp view on Meta::CPAN
<function name="raptor_xml_element_get_attributes ()" link="raptor-section-xml.html#raptor-xml-element-get-attributes"/>
<function name="raptor_xml_element_get_attributes_count ()" link="raptor-section-xml.html#raptor-xml-element-get-attributes-count"/>
<function name="raptor_xml_element_set_attributes ()" link="raptor-section-xml.html#raptor-xml-element-set-attributes"/>
<function name="raptor_xml_element_declare_namespace ()" link="raptor-section-xml.html#raptor-xml-element-declare-namespace"/>
<function name="raptor_xml_element_is_empty ()" link="raptor-section-xml.html#raptor-xml-element-is-empty"/>
<function name="raptor_new_xml_writer ()" link="raptor-section-xml.html#raptor-new-xml-writer"/>
<function name="raptor_free_xml_writer ()" link="raptor-section-xml.html#raptor-free-xml-writer"/>
<function name="raptor_xml_writer_empty_element ()" link="raptor-section-xml.html#raptor-xml-writer-empty-element"/>
<function name="raptor_xml_writer_start_element ()" link="raptor-section-xml.html#raptor-xml-writer-start-element"/>
<function name="raptor_xml_writer_end_element ()" link="raptor-section-xml.html#raptor-xml-writer-end-element"/>
<function name="raptor_xml_writer_cdata ()" link="raptor-section-xml.html#raptor-xml-writer-cdata"/>
<function name="raptor_xml_writer_cdata_counted ()" link="raptor-section-xml.html#raptor-xml-writer-cdata-counted"/>
<function name="raptor_xml_writer_raw ()" link="raptor-section-xml.html#raptor-xml-writer-raw"/>
<function name="raptor_xml_writer_raw_counted ()" link="raptor-section-xml.html#raptor-xml-writer-raw-counted"/>
<function name="raptor_xml_writer_comment ()" link="raptor-section-xml.html#raptor-xml-writer-comment"/>
<function name="raptor_xml_writer_comment_counted ()" link="raptor-section-xml.html#raptor-xml-writer-comment-counted"/>
<function name="raptor_xml_writer_features_enumerate ()" link="raptor-section-xml.html#raptor-xml-writer-features-enumerate"/>
<function name="raptor_xml_writer_set_feature ()" link="raptor-section-xml.html#raptor-xml-writer-set-feature"/>
<function name="raptor_xml_writer_set_feature_string ()" link="raptor-section-xml.html#raptor-xml-writer-set-feature-string"/>
<function name="raptor_xml_writer_get_feature ()" link="raptor-section-xml.html#raptor-xml-writer-get-feature"/>
<function name="raptor_xml_writer_get_feature_string ()" link="raptor-section-xml.html#raptor-xml-writer-get-feature-string"/>
<function name="raptor_iostream_write_xml_element ()" link="raptor-section-xml.html#raptor-iostream-write-xml-element"/>
redland/raptor/docs/html/raptor.devhelp2 view on Meta::CPAN
<keyword type="function" name="raptor_xml_element_get_attributes ()" link="raptor-section-xml.html#raptor-xml-element-get-attributes"/>
<keyword type="function" name="raptor_xml_element_get_attributes_count ()" link="raptor-section-xml.html#raptor-xml-element-get-attributes-count"/>
<keyword type="function" name="raptor_xml_element_set_attributes ()" link="raptor-section-xml.html#raptor-xml-element-set-attributes"/>
<keyword type="function" name="raptor_xml_element_declare_namespace ()" link="raptor-section-xml.html#raptor-xml-element-declare-namespace"/>
<keyword type="function" name="raptor_xml_element_is_empty ()" link="raptor-section-xml.html#raptor-xml-element-is-empty"/>
<keyword type="function" name="raptor_new_xml_writer ()" link="raptor-section-xml.html#raptor-new-xml-writer"/>
<keyword type="function" name="raptor_free_xml_writer ()" link="raptor-section-xml.html#raptor-free-xml-writer"/>
<keyword type="function" name="raptor_xml_writer_empty_element ()" link="raptor-section-xml.html#raptor-xml-writer-empty-element"/>
<keyword type="function" name="raptor_xml_writer_start_element ()" link="raptor-section-xml.html#raptor-xml-writer-start-element"/>
<keyword type="function" name="raptor_xml_writer_end_element ()" link="raptor-section-xml.html#raptor-xml-writer-end-element"/>
<keyword type="function" name="raptor_xml_writer_cdata ()" link="raptor-section-xml.html#raptor-xml-writer-cdata"/>
<keyword type="function" name="raptor_xml_writer_cdata_counted ()" link="raptor-section-xml.html#raptor-xml-writer-cdata-counted"/>
<keyword type="function" name="raptor_xml_writer_raw ()" link="raptor-section-xml.html#raptor-xml-writer-raw"/>
<keyword type="function" name="raptor_xml_writer_raw_counted ()" link="raptor-section-xml.html#raptor-xml-writer-raw-counted"/>
<keyword type="function" name="raptor_xml_writer_comment ()" link="raptor-section-xml.html#raptor-xml-writer-comment"/>
<keyword type="function" name="raptor_xml_writer_comment_counted ()" link="raptor-section-xml.html#raptor-xml-writer-comment-counted"/>
<keyword type="function" name="raptor_xml_writer_features_enumerate ()" link="raptor-section-xml.html#raptor-xml-writer-features-enumerate"/>
<keyword type="function" name="raptor_xml_writer_set_feature ()" link="raptor-section-xml.html#raptor-xml-writer-set-feature"/>
<keyword type="function" name="raptor_xml_writer_set_feature_string ()" link="raptor-section-xml.html#raptor-xml-writer-set-feature-string"/>
<keyword type="function" name="raptor_xml_writer_get_feature ()" link="raptor-section-xml.html#raptor-xml-writer-get-feature"/>
<keyword type="function" name="raptor_xml_writer_get_feature_string ()" link="raptor-section-xml.html#raptor-xml-writer-get-feature-string"/>
<keyword type="function" name="raptor_iostream_write_xml_element ()" link="raptor-section-xml.html#raptor-iostream-write-xml-element"/>
redland/raptor/docs/libraptor.3 view on Meta::CPAN
.IP "\fBvoid raptor_xml_writer_empty_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write XML element \fIelement\fP as an empty element (no element
content) to the XML Writer \fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_start_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write a start element along with an attributes and namespace
declarations for XML element \fIelement\fP to the XML Writer
\fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_end_element(raptor_xml_writer* \fIxml_writer\fP, raptor_xml_element *\fIelement\fP)\fR"
Write an end element form for XML element \fIelement\fP
to the XML Writer \fIxml_writer\fP.
.IP "\fBvoid raptor_xml_writer_cdata(raptor_xml_writer* \fIxml_writer\fP, const unsigned char *str)\fR"
Write XML character data in \fIstr\fP to the XML Writer
\fIxml_writer\fP. The characters in \fIstr\fP will be XML escaped.
.IP "\fBvoid raptor_xml_writer_cdata_counted(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP, unsigned int \fIlength\fP)\fR"
Write XML character data in \fIstr\fP of length \fIlength\fP to the XML Writer
\fIxml_writer\fP. The characters in \fIstr\fP will be XML escaped.
.IP "\fBvoid raptor_xml_writer_raw(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP)\fR"
Write character data in \fIstr\fP \fIlength\fP to the XML Writer
\fIxml_writer\fP without XML escaping.
.IP "\fBvoid raptor_xml_writer_raw_counted(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP, unsigned int \fIlength\fP)\fR"
Write character data in \fIstr\fP of length \fIlength\fP to the XML Writer
\fIxml_writer\fP without XML escaping.
.IP "\fBvoid raptor_xml_writer_comment(raptor_xml_writer* \fIxml_writer\fP, const unsigned char* \fIstr\fP)\fR"
Write an XML comment in \fIstr\fP to the XML Writer \fIxml_writer\fP.
redland/raptor/docs/libraptor.html view on Meta::CPAN
<td width="77%">
<p>Write an end element form for XML element <i>element</i> to the XML Writer <i>xml_writer</i>.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>void raptor_xml_writer_cdata(raptor_xml_writer*</b> <i>xml_writer</i><b>, const unsigned char *str)</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Write XML character data in <i>str</i> to the XML Writer <i>xml_writer</i>. The characters in <i>str</i> will be XML escaped.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>void raptor_xml_writer_cdata_counted(raptor_xml_writer*</b> <i>xml_writer</i><b>, const unsigned char*</b> <i>str</i><b>, unsigned int</b> <i>length</i><b>)</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Write XML character data in <i>str</i> of length <i>length</i> to the XML Writer <i>xml_writer</i>. The characters in <i>str</i> will be XML escaped.</p>
</td>
redland/raptor/docs/raptor-decl-list.txt view on Meta::CPAN
raptor_xml_element_get_attributes
raptor_xml_element_get_attributes_count
raptor_xml_element_declare_namespace
raptor_iostream_write_xml_element
raptor_xml_element_is_empty
raptor_new_xml_writer
raptor_free_xml_writer
raptor_xml_writer_empty_element
raptor_xml_writer_start_element
raptor_xml_writer_end_element
raptor_xml_writer_cdata
raptor_xml_writer_cdata_counted
raptor_xml_writer_raw
raptor_xml_writer_raw_counted
raptor_xml_writer_comment
raptor_xml_writer_comment_counted
raptor_xml_writer_features_enumerate
raptor_xml_writer_set_feature
raptor_xml_writer_set_feature_string
raptor_xml_writer_get_feature
raptor_xml_writer_get_feature_string
</SECTION>
redland/raptor/docs/raptor-decl.txt view on Meta::CPAN
<NAME>raptor_xml_writer_start_element</NAME>
<RETURNS>void </RETURNS>
raptor_xml_writer* xml_writer, raptor_xml_element *element
</FUNCTION>
<FUNCTION>
<NAME>raptor_xml_writer_end_element</NAME>
<RETURNS>void </RETURNS>
raptor_xml_writer* xml_writer, raptor_xml_element *element
</FUNCTION>
<FUNCTION>
<NAME>raptor_xml_writer_cdata</NAME>
<RETURNS>void </RETURNS>
raptor_xml_writer* xml_writer, const unsigned char *s
</FUNCTION>
<FUNCTION>
<NAME>raptor_xml_writer_cdata_counted</NAME>
<RETURNS>void </RETURNS>
raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len
</FUNCTION>
<FUNCTION>
<NAME>raptor_xml_writer_raw</NAME>
<RETURNS>void </RETURNS>
raptor_xml_writer* xml_writer, const unsigned char *s
</FUNCTION>
<FUNCTION>
<NAME>raptor_xml_writer_raw_counted</NAME>
redland/raptor/docs/raptor-sections.txt view on Meta::CPAN
raptor_xml_element_get_attributes
raptor_xml_element_get_attributes_count
raptor_xml_element_set_attributes
raptor_xml_element_declare_namespace
raptor_xml_element_is_empty
raptor_new_xml_writer
raptor_free_xml_writer
raptor_xml_writer_empty_element
raptor_xml_writer_start_element
raptor_xml_writer_end_element
raptor_xml_writer_cdata
raptor_xml_writer_cdata_counted
raptor_xml_writer_raw
raptor_xml_writer_raw_counted
raptor_xml_writer_comment
raptor_xml_writer_comment_counted
raptor_xml_writer_features_enumerate
raptor_xml_writer_set_feature
raptor_xml_writer_set_feature_string
raptor_xml_writer_get_feature
raptor_xml_writer_get_feature_string
raptor_iostream_write_xml_element
redland/raptor/docs/tmpl/section-xml.sgml view on Meta::CPAN
<!-- ##### FUNCTION raptor_xml_writer_end_element ##### -->
<para>
</para>
@xml_writer:
@element:
<!-- ##### FUNCTION raptor_xml_writer_cdata ##### -->
<para>
</para>
@xml_writer:
@s:
<!-- ##### FUNCTION raptor_xml_writer_cdata_counted ##### -->
<para>
</para>
@xml_writer:
@s:
@len:
<!-- ##### FUNCTION raptor_xml_writer_raw ##### -->
redland/raptor/docs/xml/section-xml.xml view on Meta::CPAN
<link linkend="raptor-simple-message-handler">raptor_simple_message_handler</link> error_handler,
<link linkend="void">void</link> *error_data,
<link linkend="int">int</link> canonicalize);
<link linkend="void">void</link> <link linkend="raptor-free-xml-writer">raptor_free_xml_writer</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-empty-element">raptor_xml_writer_empty_element</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
<link linkend="raptor-xml-element">raptor_xml_element</link> *element);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-start-element">raptor_xml_writer_start_element</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
<link linkend="raptor-xml-element">raptor_xml_element</link> *element);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-end-element">raptor_xml_writer_end_element</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
<link linkend="raptor-xml-element">raptor_xml_element</link> *element);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-cdata">raptor_xml_writer_cdata</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-cdata-counted">raptor_xml_writer_cdata_counted</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s,
unsigned <link linkend="int">int</link> len);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-raw">raptor_xml_writer_raw</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-raw-counted">raptor_xml_writer_raw_counted</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s,
unsigned <link linkend="int">int</link> len);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-comment">raptor_xml_writer_comment</link> (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s);
<link linkend="void">void</link> <link linkend="raptor-xml-writer-comment-counted">raptor_xml_writer_comment_counted</link>
redland/raptor/docs/xml/section-xml.xml view on Meta::CPAN
</para><variablelist role="params">
<varlistentry><term><parameter>xml_writer</parameter> :</term>
<listitem><simpara> XML writer object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>element</parameter> :</term>
<listitem><simpara> XML element object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-xml-writer-cdata" role="function"/>raptor_xml_writer_cdata ()</title>
<indexterm><primary>raptor_xml_writer_cdata</primary></indexterm><programlisting><link linkend="void">void</link> raptor_xml_writer_cdata (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s);</programlisting>
<para>
Write CDATA XML-escaped to the XML writer.
</para>
<para>
Closes any previous empty element if XML writer feature AUTO_EMPTY
is enabled.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml_writer</parameter> :</term>
<listitem><simpara> XML writer object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>s</parameter> :</term>
<listitem><simpara> string to XML escape and write
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-xml-writer-cdata-counted" role="function"/>raptor_xml_writer_cdata_counted ()</title>
<indexterm><primary>raptor_xml_writer_cdata_counted</primary></indexterm><programlisting><link linkend="void">void</link> raptor_xml_writer_cdata_counted (<link linkend="raptor-xml-writer">raptor_xml_writer</link> *xml_writer,
unsigned <link linkend="char">char</link> *s,
unsigned <link linkend="int">int</link> len);</programlisting>
<para>
Write counted CDATA XML-escaped to the XML writer.
</para>
<para>
Closes any previous empty element if XML writer feature AUTO_EMPTY
is enabled.</para>
<para>
redland/raptor/src/n3_parser.c view on Meta::CPAN
raptor_free_uri(n3_parser->rest_uri);
raptor_namespaces_clear(&n3_parser->namespaces);
if(n3_parser->scanner_set) {
n3_lexer_lex_destroy(n3_parser->scanner);
n3_parser->scanner_set=0;
}
if(n3_parser->buffer_length)
RAPTOR_FREE(cdata, n3_parser->buffer);
}
static void
raptor_n3_generate_statement(raptor_parser *parser, raptor_triple *t)
{
/* raptor_n3_parser *n3_parser=(raptor_n3_parser*)parser->context; */
raptor_statement *statement=&parser->statement;
if(!t->subject || !t->predicate || !t->object)
redland/raptor/src/n3_parser.c view on Meta::CPAN
#endif
if(len) {
buffer=(char*)RAPTOR_REALLOC(cstring, n3_parser->buffer, n3_parser->buffer_length + len + 1);
if(!buffer) {
raptor_parser_fatal_error(rdf_parser, "Out of memory");
return 1;
}
n3_parser->buffer=buffer;
/* move pointer to end of cdata buffer */
ptr=buffer+n3_parser->buffer_length;
/* adjust stored length */
n3_parser->buffer_length += len;
/* now write new stuff at end of cdata buffer */
strncpy(ptr, (char*)s, len);
ptr += len;
*ptr = '\0';
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
RAPTOR_DEBUG3("buffer buffer now '%s' (%d bytes)\n",
n3_parser->buffer, n3_parser->buffer_length);
#endif
}
redland/raptor/src/n3_parser.c view on Meta::CPAN
/* base URI required for N3 */
if(!rdf_parser->base_uri)
return 1;
locator->line=1;
locator->column= -1; /* No column info */
locator->byte= -1; /* No bytes info */
if(n3_parser->buffer_length) {
RAPTOR_FREE(cdata, n3_parser->buffer);
n3_parser->buffer=NULL;
n3_parser->buffer_length=0;
}
n3_parser->lineno=1;
return 0;
}
redland/raptor/src/n3_parser.y view on Meta::CPAN
raptor_free_uri(n3_parser->rest_uri);
raptor_namespaces_clear(&n3_parser->namespaces);
if(n3_parser->scanner_set) {
n3_lexer_lex_destroy(n3_parser->scanner);
n3_parser->scanner_set=0;
}
if(n3_parser->buffer_length)
RAPTOR_FREE(cdata, n3_parser->buffer);
}
static void
raptor_n3_generate_statement(raptor_parser *parser, raptor_triple *t)
{
/* raptor_n3_parser *n3_parser=(raptor_n3_parser*)parser->context; */
raptor_statement *statement=&parser->statement;
if(!t->subject || !t->predicate || !t->object)
redland/raptor/src/n3_parser.y view on Meta::CPAN
#endif
if(len) {
buffer=(char*)RAPTOR_REALLOC(cstring, n3_parser->buffer, n3_parser->buffer_length + len + 1);
if(!buffer) {
raptor_parser_fatal_error(rdf_parser, "Out of memory");
return 1;
}
n3_parser->buffer=buffer;
/* move pointer to end of cdata buffer */
ptr=buffer+n3_parser->buffer_length;
/* adjust stored length */
n3_parser->buffer_length += len;
/* now write new stuff at end of cdata buffer */
strncpy(ptr, (char*)s, len);
ptr += len;
*ptr = '\0';
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
RAPTOR_DEBUG3("buffer buffer now '%s' (%d bytes)\n",
n3_parser->buffer, n3_parser->buffer_length);
#endif
}
redland/raptor/src/n3_parser.y view on Meta::CPAN
/* base URI required for N3 */
if(!rdf_parser->base_uri)
return 1;
locator->line=1;
locator->column= -1; /* No column info */
locator->byte= -1; /* No bytes info */
if(n3_parser->buffer_length) {
RAPTOR_FREE(cdata, n3_parser->buffer);
n3_parser->buffer=NULL;
n3_parser->buffer_length=0;
}
n3_parser->lineno=1;
return 0;
}
redland/raptor/src/ntriples_parse.c view on Meta::CPAN
/*
* raptor_ntriples_parse_terminate - Free the Raptor NTriples parser
* @rdf_parser: parser object
*
**/
static void
raptor_ntriples_parse_terminate(raptor_parser* rdf_parser)
{
raptor_ntriples_parser_context *ntriples_parser=(raptor_ntriples_parser_context*)rdf_parser->context;
if(ntriples_parser->line_length)
RAPTOR_FREE(cdata, ntriples_parser->line);
}
static const char *term_type_strings[]={
"URIref",
"bnodeID",
"Literal"
};
redland/raptor/src/ntriples_parse.c view on Meta::CPAN
return 1;
}
if(ntriples_parser->line_length) {
strncpy((char*)buffer, (const char*)ntriples_parser->line, ntriples_parser->line_length);
RAPTOR_FREE(cstring, ntriples_parser->line);
}
ntriples_parser->line=buffer;
/* move pointer to end of cdata buffer */
ptr=buffer+ntriples_parser->line_length;
/* adjust stored length */
ntriples_parser->line_length += len;
/* now write new stuff at end of cdata buffer */
strncpy((char*)ptr, (const char*)s, len);
ptr += len;
*ptr = '\0';
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
RAPTOR_DEBUG2("buffer now %d bytes\n", ntriples_parser->line_length);
#endif
ptr=buffer+ntriples_parser->offset;
while(*(start=ptr)) {
redland/raptor/src/raptor.h view on Meta::CPAN
raptor_xml_writer* raptor_new_xml_writer(raptor_namespace_stack *nstack, raptor_uri_handler *uri_handler, void *uri_context, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize);
RAPTOR_API
void raptor_free_xml_writer(raptor_xml_writer* xml_writer);
RAPTOR_API
void raptor_xml_writer_empty_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
RAPTOR_API
void raptor_xml_writer_start_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
RAPTOR_API
void raptor_xml_writer_end_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
RAPTOR_API
void raptor_xml_writer_cdata(raptor_xml_writer* xml_writer, const unsigned char *s);
RAPTOR_API
void raptor_xml_writer_cdata_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
RAPTOR_API
void raptor_xml_writer_raw(raptor_xml_writer* xml_writer, const unsigned char *s);
RAPTOR_API
void raptor_xml_writer_raw_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
RAPTOR_API
void raptor_xml_writer_comment(raptor_xml_writer* xml_writer, const unsigned char *s);
RAPTOR_API
void raptor_xml_writer_comment_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
RAPTOR_API
int raptor_xml_writer_features_enumerate(const raptor_feature feature, const char **name, raptor_uri **uri, const char **label);
redland/raptor/src/raptor_internal.h view on Meta::CPAN
/* raptor_parse.c */
typedef struct raptor_rdfxml_parser_s raptor_rdfxml_parser;
/* Prototypes for common expat/libxml parsing event-handling functions */
extern void raptor_xml_start_element_handler(void *user_data, const unsigned char *name, const unsigned char **atts);
extern void raptor_xml_end_element_handler(void *user_data, const unsigned char *name);
/* s is not 0 terminated. */
extern void raptor_xml_characters_handler(void *user_data, const unsigned char *s, int len);
extern void raptor_xml_cdata_handler(void *user_data, const unsigned char *s, int len);
void raptor_xml_comment_handler(void *user_data, const unsigned char *s);
#ifdef RAPTOR_DEBUG
void raptor_rdfxml_parser_stats_print(raptor_rdfxml_parser* rdf_xml_parser, FILE *stream);
#endif
void raptor_parser_copy_user_state(raptor_parser *to_parser, raptor_parser *from_parser);
/* raptor_feature.c */
int raptor_features_enumerate_common(const raptor_feature feature, const char **name, raptor_uri **uri, const char **label, int flags);
redland/raptor/src/raptor_internal.h view on Meta::CPAN
raptor_qname **attributes;
unsigned int attribute_count;
/* value of xml:lang attribute on this element or NULL */
const unsigned char *xml_language;
/* URI of xml:base attribute value on this element or NULL */
raptor_uri *base_uri;
/* CDATA content of element and checks for mixed content */
raptor_stringbuffer* content_cdata_sb;
unsigned int content_cdata_length;
/* how many cdata blocks seen */
unsigned int content_cdata_seen;
/* how many contained elements seen */
unsigned int content_element_seen;
raptor_sequence *declared_nspaces;
void* user_data;
};
/* start of an element */
typedef void (*raptor_sax2_start_element_handler)(void *user_data, raptor_xml_element *xml_element);
/* end of an element */
typedef void (*raptor_sax2_end_element_handler)(void *user_data, raptor_xml_element* xml_element);
/* characters */
typedef void (*raptor_sax2_characters_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len);
/* like <![CDATA[...]> */
typedef void (*raptor_sax2_cdata_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len);
/* comment */
typedef void (*raptor_sax2_comment_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s);
/* unparsed (NDATA) entity */
typedef void (*raptor_sax2_unparsed_entity_decl_handler)(void *user_data, const unsigned char* entityName, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId, const unsigned char* notationName);
/* external entity reference */
typedef int (*raptor_sax2_external_entity_ref_handler)(void *user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId);
struct raptor_sax2_s {
#ifdef RAPTOR_XML_LIBXML
int magic;
redland/raptor/src/raptor_internal.h view on Meta::CPAN
raptor_xml_element *root_element;
raptor_xml_element *current_element;
/* start of an element */
raptor_sax2_start_element_handler start_element_handler;
/* end of an element */
raptor_sax2_end_element_handler end_element_handler;
/* characters */
raptor_sax2_characters_handler characters_handler;
/* like <![CDATA[...]> */
raptor_sax2_cdata_handler cdata_handler;
/* comment */
raptor_sax2_comment_handler comment_handler;
/* unparsed (NDATA) entity */
raptor_sax2_unparsed_entity_decl_handler unparsed_entity_decl_handler;
/* external entity reference */
raptor_sax2_external_entity_ref_handler external_entity_ref_handler;
raptor_locator *locator;
void *error_data;
redland/raptor/src/raptor_internal.h view on Meta::CPAN
void raptor_sax2_init(void);
void raptor_sax2_finish(void);
raptor_sax2* raptor_new_sax2(void *user_data, void *error_data, raptor_message_handler error_handler, void *fatal_error_data, raptor_message_handler fatal_error_handler, void *warning_data, raptor_message_handler warning_handler);
void raptor_free_sax2(raptor_sax2 *sax2);
void raptor_sax2_set_start_element_handler(raptor_sax2* sax2, raptor_sax2_start_element_handler handler);
void raptor_sax2_set_end_element_handler(raptor_sax2* sax2, raptor_sax2_end_element_handler handler);
void raptor_sax2_set_characters_handler(raptor_sax2* sax2, raptor_sax2_characters_handler handler);
void raptor_sax2_set_cdata_handler(raptor_sax2* sax2, raptor_sax2_cdata_handler handler);
void raptor_sax2_set_comment_handler(raptor_sax2* sax2, raptor_sax2_comment_handler handler);
void raptor_sax2_set_unparsed_entity_decl_handler(raptor_sax2* sax2, raptor_sax2_unparsed_entity_decl_handler handler);
void raptor_sax2_set_external_entity_ref_handler(raptor_sax2* sax2, raptor_sax2_external_entity_ref_handler handler);
void raptor_sax2_set_namespace_handler(raptor_sax2* sax2, raptor_namespace_handler handler);
void raptor_sax2_set_locator(raptor_sax2* sax2, raptor_locator* locator);
void raptor_sax2_parse_start(raptor_sax2 *sax2, raptor_uri *base_uri);
int raptor_sax2_parse_chunk(raptor_sax2* sax2, const unsigned char *buffer, size_t len, int is_end);
void raptor_sax2_parse_handle_errors(raptor_sax2* sax2);
raptor_xml_element* raptor_xml_element_pop(raptor_sax2* sax2);
redland/raptor/src/raptor_internal.h view on Meta::CPAN
void raptor_sax2_update_document_locator(raptor_sax2* sax2, raptor_locator* locator);
int raptor_sax2_set_feature(raptor_sax2* sax2, raptor_feature feature, int value);
#ifdef RAPTOR_DEBUG
void raptor_print_xml_element(raptor_xml_element *element, FILE* stream);
#endif
void raptor_sax2_start_element(void* user_data, const unsigned char *name, const unsigned char **atts);
void raptor_sax2_end_element(void* user_data, const unsigned char *name);
void raptor_sax2_characters(void* user_data, const unsigned char *s, int len);
void raptor_sax2_cdata(void* user_data, const unsigned char *s, int len);
void raptor_sax2_comment(void* user_data, const unsigned char *s);
void raptor_sax2_unparsed_entity_decl(void* user_data, const unsigned char* entityName, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId, const unsigned char* notationName);
int raptor_sax2_external_entity_ref(void* user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId);
/* turtle_parser.y and turtle_lexer.l */
typedef struct raptor_turtle_parser_s raptor_turtle_parser;
/* n3_parser.y and n3_lexer.l */
typedef struct raptor_n3_parser_s raptor_n3_parser;
redland/raptor/src/raptor_libxml.c view on Meta::CPAN
sax->elementDecl = NULL; /* elementDecl */
sax->notationDecl = NULL; /* notationDecl */
sax->unparsedEntityDecl = raptor_libxml_unparsedEntityDecl;
sax->setDocumentLocator = raptor_libxml_set_document_locator;
sax->startDocument = raptor_libxml_startDocument;
sax->endDocument = raptor_libxml_endDocument;
sax->startElement= raptor_sax2_start_element;
sax->endElement= raptor_sax2_end_element;
sax->reference = NULL; /* reference */
sax->characters= raptor_sax2_characters;
sax->cdataBlock= raptor_sax2_cdata; /* like <![CDATA[...]> */
sax->ignorableWhitespace= raptor_sax2_cdata;
sax->processingInstruction = NULL; /* processingInstruction */
sax->comment = raptor_sax2_comment; /* comment */
sax->warning=(warningSAXFunc)raptor_libxml_warning;
sax->error=(errorSAXFunc)raptor_libxml_error;
sax->fatalError=(fatalErrorSAXFunc)raptor_libxml_fatal_error;
#ifdef RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET
sax->externalSubset = raptor_libxml_externalSubset;
#endif
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
return rdf_syntax_terms_info[i].forbidden_as_propertyAttribute;
return -1;
}
typedef enum {
/* undetermined yet - whitespace is stored */
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_UNKNOWN,
/* literal content - no elements, cdata allowed, whitespace significant
* <propElement> blah </propElement>
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL,
/* parseType literal content (WF XML) - all content preserved
* <propElement rdf:parseType="Literal"><em>blah</em></propElement>
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL,
/* top-level nodes - 0+ elements expected, no cdata, whitespace ignored,
* any non-whitespace cdata is error
* only used for <rdf:RDF> or implict <rdf:RDF>
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_NODES,
/* properties - 0+ elements expected, no cdata, whitespace ignored,
* any non-whitespace cdata is error
* <nodeElement><prop1>blah</prop1> <prop2>blah</prop2> </nodeElement>
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES,
/* property content - all content preserved
* any content type changes when first non-whitespace found
* <propElement>...
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT,
/* resource URI given - no element, no cdata, whitespace ignored,
* any non-whitespace cdata is error
* <propElement rdf:resource="uri"/>
* <propElement rdf:resource="uri"></propElement>
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE,
/* skipping content - all content is preserved
* Used when skipping content for unknown parseType-s,
* error recovery, some other reason
*/
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED,
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
/* dummy for use in strings below */
RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST
} raptor_rdfxml_element_content_type;
static const struct {
const char * const name;
const int whitespace_significant;
/* non-blank cdata */
const int cdata_allowed;
/* XML element content */
const int element_allowed;
/* Do RDF-specific processing? (property attributes, rdf: attributes, ...) */
const int rdf_processing;
} rdf_content_type_info[RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST]={
{"Unknown", 1, 1, 1, 0 },
{"Literal", 1, 1, 0, 0 },
{"XML Literal", 1, 1, 1, 0 },
{"Nodes", 0, 0, 1, 1 },
{"Properties", 0, 1, 1, 1 },
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
/* last ordinal used, so initialising to 0 works, emitting rdf:_1 first */
int last_ordinal;
/* If this element's parseType is a Collection
* this identifies the anon node of current tail of the collection(list).
*/
const unsigned char *tail_id;
/* RDF/XML specific checks */
/* all cdata so far is whitespace */
unsigned int content_cdata_all_whitespace;
};
typedef struct raptor_rdfxml_element_s raptor_rdfxml_element;
#define RAPTOR_RDFXML_N_CONCEPTS 22
/*
* Raptor parser object
*/
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
/* prototypes for element functions */
static raptor_rdfxml_element* raptor_rdfxml_element_pop(raptor_rdfxml_parser *rdf_parser);
static void raptor_rdfxml_element_push(raptor_rdfxml_parser *rdf_parser, raptor_rdfxml_element* element);
static int raptor_rdfxml_record_ID(raptor_parser *rdf_parser, raptor_rdfxml_element *element, const unsigned char *id);
/* prototypes for grammar functions */
static void raptor_rdfxml_start_element_grammar(raptor_parser *parser, raptor_rdfxml_element *element);
static void raptor_rdfxml_end_element_grammar(raptor_parser *parser, raptor_rdfxml_element *element);
static void raptor_rdfxml_cdata_grammar(raptor_parser *parser, const unsigned char *s, int len, int is_cdata);
/* prototype for statement related functions */
static void raptor_rdfxml_generate_statement(raptor_parser *rdf_parser, raptor_uri *subject_uri, const unsigned char *subject_id, const raptor_identifier_type subject_type, const raptor_uri_source subject_uri_source, raptor_uri *predicate_uri, const ...
/* Prototypes for parsing data functions */
static int raptor_rdfxml_parse_init(raptor_parser* rdf_parser, const char *name);
static void raptor_rdfxml_parse_terminate(raptor_parser *rdf_parser);
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
} else {
if(!element->parent->child_state)
raptor_parser_fatal_error(rdf_parser, "raptor_rdfxml_start_element_handler: no parent element child_state set");
element->state=element->parent->child_state;
element->parent->xml_element->content_element_seen++;
count_bumped++;
/* leave literal XML alone */
if (!rdf_content_type_info[element->content_type].cdata_allowed) {
if(element->parent->xml_element->content_element_seen &&
element->parent->xml_element->content_cdata_seen) {
/* Uh oh - mixed content, the parent element has cdata too */
raptor_parser_warning(rdf_parser, "element '%s' has mixed content.",
raptor_xml_element_get_name(element->parent->xml_element)->local_name);
}
/* If there is some existing all-whitespace content cdata
* before this node element, delete it
*/
if(element->parent->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES &&
element->parent->xml_element->content_element_seen &&
element->parent->content_cdata_all_whitespace &&
element->parent->xml_element->content_cdata_length) {
element->parent->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE;
raptor_free_stringbuffer(element->parent->xml_element->content_cdata_sb);
element->parent->xml_element->content_cdata_sb=NULL;
element->parent->xml_element->content_cdata_length=0;
}
} /* end if leave literal XML alone */
} /* end if parent has no rdf:resource */
} /* end if element->parent */
#ifdef RAPTOR_DEBUG_VERBOSE
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
if(element->state != RAPTOR_STATE_MEMBER_PROPERTYELT &&
element->state != RAPTOR_STATE_PARSETYPE_RESOURCE)
element->parent->child_state=element->state;
}
raptor_free_rdfxml_element(element);
}
}
/* cdata (and ignorable whitespace for libxml).
* s is not 0 terminated for expat, is for libxml - grrrr.
*/
static void
raptor_rdfxml_characters_handler(void *user_data,
raptor_xml_element* xml_element,
const unsigned char *s, int len)
{
raptor_parser* rdf_parser=(raptor_parser*)user_data;
raptor_rdfxml_cdata_grammar(rdf_parser, s, len, 0);
}
/* cdata (and ignorable whitespace for libxml).
* s is not 0 terminated for expat, is for libxml - grrrr.
*/
static void
raptor_rdfxml_cdata_handler(void *user_data, raptor_xml_element* xml_element,
const unsigned char *s, int len)
{
raptor_parser* rdf_parser=(raptor_parser*)user_data;
raptor_rdfxml_cdata_grammar(rdf_parser, s, len, 1);
}
/* This is called for a declaration of an unparsed (NDATA) entity */
static void
raptor_rdfxml_unparsed_entity_decl_handler(void *user_data,
const unsigned char* entityName,
const unsigned char* base,
const unsigned char* systemId,
const unsigned char* publicId,
const unsigned char* notationName)
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
sax2=raptor_new_sax2(rdf_parser,
rdf_parser, raptor_parser_error_message_handler,
rdf_parser, raptor_parser_fatal_error_message_handler,
rdf_parser, raptor_parser_warning_message_handler);
rdf_xml_parser->sax2=sax2;
raptor_sax2_set_start_element_handler(sax2, raptor_rdfxml_start_element_handler);
raptor_sax2_set_end_element_handler(sax2, raptor_rdfxml_end_element_handler);
raptor_sax2_set_characters_handler(sax2, raptor_rdfxml_characters_handler);
raptor_sax2_set_cdata_handler(sax2, raptor_rdfxml_cdata_handler);
raptor_sax2_set_comment_handler(sax2, raptor_rdfxml_comment_handler);
raptor_sax2_set_unparsed_entity_decl_handler(sax2, raptor_rdfxml_unparsed_entity_decl_handler);
raptor_sax2_set_external_entity_ref_handler(sax2, raptor_rdfxml_external_entity_ref_handler);
raptor_sax2_set_namespace_handler(sax2, raptor_rdfxml_sax2_new_namespace_handler);
raptor_sax2_set_locator(sax2, &rdf_parser->locator);
RAPTOR_RDF_type_URI(rdf_xml_parser)=raptor_new_uri_for_rdf_concept("type");
RAPTOR_RDF_value_URI(rdf_xml_parser)=raptor_new_uri_for_rdf_concept("value");
RAPTOR_RDF_subject_URI(rdf_xml_parser)=raptor_new_uri_for_rdf_concept("subject");
RAPTOR_RDF_predicate_URI(rdf_xml_parser)=raptor_new_uri_for_rdf_concept("predicate");
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
case RAPTOR_STATE_MEMBER_PROPERTYELT:
/* A property element
* http://www.w3.org/TR/rdf-syntax-grammar/#propertyElt
*
* Literal content part is handled here.
* The element content is handled in the internal states
* Empty content is checked here.
*/
if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT) {
if(xml_element->content_cdata_seen)
element->content_type= RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL;
else if (xml_element->content_element_seen)
element->content_type= RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES;
else { /* Empty Literal */
element->object.type= RAPTOR_IDENTIFIER_TYPE_LITERAL;
element->content_type= RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL;
}
}
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
raptor_rdfxml_process_property_attributes(rdf_parser, element,
element->parent,
&element->object);
}
/* We know object is a resource, so delete any unsignficant
* whitespace so that FALLTHROUGH code below finds the object.
*/
if(xml_element->content_cdata_length) {
raptor_free_stringbuffer(xml_element->content_cdata_sb);
xml_element->content_cdata_sb=NULL;
xml_element->content_cdata_length=0;
}
/* FALLTHROUGH */
case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL:
if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL) {
if(rdf_parser->features[RAPTOR_FEATURE_ALLOW_BAGID]) {
/* Only an empty literal can have a rdf:bagID */
if(element->bag.uri || element->bag.id) {
if(xml_element->content_cdata_length > 0) {
raptor_parser_error(rdf_parser, "rdf:bagID is forbidden on a literal property element '%s'.", el_name);
/* prevent this being used later either */
element->rdf_attr[RDF_ATTR_bagID]=NULL;
} else
raptor_rdfxml_generate_statement(rdf_parser,
element->bag.uri,
element->bag.id,
element->bag.type,
element->bag.uri_source,
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
NULL,
NULL);
}
} /* if rdf:bagID */
/* If there is empty literal content with properties
* generate a node to hang properties off
*/
if(raptor_rdfxml_element_has_property_attributes(element) &&
xml_element->content_cdata_length > 0) {
raptor_parser_error(rdf_parser, "Literal property element '%s' has property attributes", el_name);
state=RAPTOR_STATE_SKIPPING;
element->child_state=RAPTOR_STATE_SKIPPING;
finished=1;
break;
}
if(element->object.type == RAPTOR_IDENTIFIER_TYPE_LITERAL &&
raptor_rdfxml_element_has_property_attributes(element) &&
!element->object.uri) {
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
} else {
predicate_uri=raptor_xml_element_get_name(xml_element)->uri;
predicate_type=RAPTOR_IDENTIFIER_TYPE_RESOURCE;
}
if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL) {
unsigned char* literal;
object_type=RAPTOR_IDENTIFIER_TYPE_LITERAL;
literal=raptor_stringbuffer_as_string(xml_element->content_cdata_sb);
literal_datatype=element->object_literal_datatype;
if(!literal_datatype && literal &&
!raptor_utf8_is_nfc(literal, xml_element->content_cdata_length)) {
const char *message="Property element '%s' has a string not in Unicode Normal Form C: %s";
raptor_rdfxml_update_document_locator(rdf_parser);
if(rdf_parser->features[RAPTOR_FEATURE_NON_NFC_FATAL])
raptor_parser_error(rdf_parser, message, el_name, literal);
else
raptor_parser_warning(rdf_parser, message, el_name, literal);
}
if(!literal)
/* empty literal */
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
unsigned char *buffer;
unsigned int length;
if(rdf_xml_parser->xml_writer) {
raptor_free_iostream(rdf_xml_parser->iostream);
rdf_xml_parser->iostream=NULL;
buffer=(unsigned char*)rdf_xml_parser->xml_content;
length=rdf_xml_parser->xml_content_length;
} else {
buffer=raptor_stringbuffer_as_string(xml_element->content_cdata_sb);
length=xml_element->content_cdata_length;
}
if(!raptor_utf8_is_nfc(buffer, length)) {
const char *message="Property element '%s' has XML literal content not in Unicode Normal Form C: %s";
raptor_rdfxml_update_document_locator(rdf_parser);
if(rdf_parser->features[RAPTOR_FEATURE_NON_NFC_FATAL])
raptor_parser_error(rdf_parser, message, el_name, buffer);
else
raptor_parser_warning(rdf_parser, message, el_name, buffer);
}
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
#ifdef RAPTOR_DEBUG_VERBOSE
RAPTOR_DEBUG2("Ending in state %s\n", raptor_rdfxml_state_as_string(state));
#endif
}
static void
raptor_rdfxml_cdata_grammar(raptor_parser *rdf_parser,
const unsigned char *s, int len,
int is_cdata)
{
raptor_rdfxml_parser* rdf_xml_parser;
raptor_rdfxml_element* element;
raptor_xml_element* xml_element;
raptor_state state;
int all_whitespace=1;
int i;
rdf_xml_parser=(raptor_rdfxml_parser*)rdf_parser->context;
if(rdf_parser->failed)
return;
#ifdef RAPTOR_DEBUG_CDATA
RAPTOR_DEBUG2("Adding characters (is_cdata=%d): '", is_cdata);
(void)fwrite(s, 1, len, stderr);
fprintf(stderr, "' (%d bytes)\n", len);
#endif
for(i=0; i<len; i++)
if(!isspace(s[i])) {
all_whitespace=0;
break;
}
element=rdf_xml_parser->current_element;
xml_element=element->xml_element;
/* this file is very broke - probably not XML, whatever */
if(!element)
return;
raptor_rdfxml_update_document_locator(rdf_parser);
/* cdata never changes the parser state
* and the containing element state always determines what to do.
* Use the child_state first if there is one, since that applies
*/
state=element->child_state;
#ifdef RAPTOR_DEBUG_VERBOSE
RAPTOR_DEBUG2("Working in state %s\n", raptor_rdfxml_state_as_string(state));
#endif
#ifdef RAPTOR_DEBUG_VERBOSE
RAPTOR_DEBUG3("Content type %s (%d)\n", raptor_rdfxml_element_content_type_as_string(element->content_type), element->content_type);
#endif
if(state == RAPTOR_STATE_SKIPPING)
return;
if(state == RAPTOR_STATE_UNKNOWN) {
/* Ignore all cdata if still looking for RDF */
if(rdf_parser->features[RAPTOR_FEATURE_SCANNING])
return;
/* Ignore all whitespace cdata before first element */
if(all_whitespace)
return;
/* This probably will never happen since that would make the
* XML not be well-formed
*/
raptor_parser_warning(rdf_parser, "Character data before RDF element.");
}
redland/raptor/src/raptor_rdfxml.c view on Meta::CPAN
if(!all_whitespace)
element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL;
}
if(!rdf_content_type_info[element->child_content_type].whitespace_significant) {
/* Whitespace is ignored except for literal or preserved content types */
if(all_whitespace) {
#ifdef RAPTOR_DEBUG_CDATA
RAPTOR_DEBUG2("Ignoring whitespace cdata inside element '%s'\n", raptor_xml_element_get_name(element->parent->xml_element)->local_name);
#endif
return;
}
if(xml_element->content_cdata_seen && xml_element->content_element_seen) {
/* Uh oh - mixed content, this element has elements too */
raptor_parser_warning(rdf_parser, "element '%s' has mixed content.",
raptor_xml_element_get_name(element->parent->xml_element)->local_name);
}
}
if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT) {
element->content_type=RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL;
#ifdef RAPTOR_DEBUG_VERBOSE
RAPTOR_DEBUG3("Content type changed to %s (%d)\n", raptor_rdfxml_element_content_type_as_string(element->content_type), element->content_type);
#endif
}
if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL)
raptor_xml_writer_cdata_counted(rdf_xml_parser->xml_writer, s, len);
else {
raptor_stringbuffer_append_counted_string(xml_element->content_cdata_sb,
s, len, 1);
element->content_cdata_all_whitespace &= all_whitespace;
/* adjust stored length */
xml_element->content_cdata_length += len;
}
#ifdef RAPTOR_DEBUG_CDATA
RAPTOR_DEBUG3("Content cdata now: %d bytes\n", xml_element->content_cdata_length);
#endif
#ifdef RAPTOR_DEBUG_VERBOSE
RAPTOR_DEBUG2("Ending in state %s\n", raptor_rdfxml_state_as_string(state));
#endif
}
/**
* raptor_rdfxml_inscope_base_uri:
redland/raptor/src/raptor_rss.c view on Meta::CPAN
#include "raptor_rss.h"
/* local prototypes */
static void raptor_rss_insert_identifiers(raptor_parser* rdf_parser);
static void raptor_rss_uplift_items(raptor_parser* rdf_parser);
static int raptor_rss_emit(raptor_parser* rdf_parser);
static void raptor_rss_start_element_handler(void *user_data, raptor_xml_element* xml_element);
static void raptor_rss_end_element_handler(void *user_data, raptor_xml_element* xml_element);
static void raptor_rss_cdata_handler(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len);
static void raptor_rss_comment_handler(void *user_data, raptor_xml_element* xml_element, const unsigned char *s);
/*
* RSS parser object
*/
struct raptor_rss_parser_s {
/* static model */
raptor_rss_model model;
/* current line */
redland/raptor/src/raptor_rss.c view on Meta::CPAN
raptor_rss_content_type type;
/* 1) XML */
raptor_xml_writer* xml_writer;
/* XML written to this iostream to the xml_content string */
raptor_iostream* iostream;
/* ends up here */
void *xml_content;
size_t xml_content_length;
/* 2) cdata */
raptor_stringbuffer* sb;
};
typedef struct raptor_rss_element_s raptor_rss_element;
static void
raptor_free_rss_element(raptor_rss_element *rss_element)
{
if(rss_element->uri)
redland/raptor/src/raptor_rss.c view on Meta::CPAN
}
sax2=raptor_new_sax2(rdf_parser,
rdf_parser, raptor_parser_error_message_handler,
rdf_parser, raptor_parser_fatal_error_message_handler,
rdf_parser, raptor_parser_warning_message_handler);
rss_parser->sax2=sax2;
raptor_sax2_set_start_element_handler(sax2, raptor_rss_start_element_handler);
raptor_sax2_set_end_element_handler(sax2, raptor_rss_end_element_handler);
raptor_sax2_set_characters_handler(sax2, raptor_rss_cdata_handler);
raptor_sax2_set_cdata_handler(sax2, raptor_rss_cdata_handler);
raptor_sax2_set_comment_handler(sax2, raptor_rss_comment_handler);
raptor_sax2_set_locator(sax2, &rdf_parser->locator);
return 0;
}
static void
raptor_rss_parse_terminate(raptor_parser *rdf_parser)
redland/raptor/src/raptor_rss.c view on Meta::CPAN
static void
raptor_rss_end_element_handler(void *user_data,
raptor_xml_element* xml_element)
{
raptor_parser* rdf_parser;
raptor_rss_parser* rss_parser;
#ifdef RAPTOR_DEBUG
const unsigned char* name=raptor_xml_element_get_name(xml_element)->local_name;
#endif
raptor_rss_element* rss_element;
size_t cdata_len=0;
unsigned char* cdata=NULL;
rss_element=(raptor_rss_element*)xml_element->user_data;
rdf_parser=(raptor_parser*)user_data;
rss_parser=(raptor_rss_parser*)rdf_parser->context;
if(rss_element->xml_writer) {
if(rss_element->type != RAPTOR_RSS_CONTENT_TYPE_XML) {
raptor_xml_writer_end_element(rss_element->xml_writer, xml_element);
goto tidy_end_element;
}
/* otherwise we are done making XML */
raptor_free_iostream(rss_element->iostream);
rss_element->iostream=NULL;
cdata=(unsigned char*)rss_element->xml_content;
cdata_len=rss_element->xml_content_length;
}
if(rss_element->sb) {
cdata_len=raptor_stringbuffer_length(rss_element->sb);
cdata=raptor_stringbuffer_as_string(rss_element->sb);
}
if(cdata) {
raptor_uri* base_uri=NULL;
base_uri=raptor_sax2_inscope_base_uri(rss_parser->sax2);
if((rss_parser->current_type==RAPTOR_RSS_NONE ||
rss_parser->current_type==RAPTOR_RSS_UNKNOWN) ||
(rss_parser->current_field==RAPTOR_RSS_FIELD_NONE ||
rss_parser->current_field==RAPTOR_RSS_FIELD_UNKNOWN)) {
unsigned char *p=cdata;
int i;
for(i=cdata_len; i>0 && *p; i--) {
if(!isspace(*p))
break;
p++;
}
if(i>0 && *p) {
RAPTOR_DEBUG4("IGNORING non-whitespace text '%s' inside type %s, field %s\n", cdata,
raptor_rss_types_info[rss_parser->current_type].name,
raptor_rss_fields_info[rss_parser->current_field].name);
}
goto tidy_end_element;
}
if(rss_parser->current_type >= RAPTOR_RSS_COMMON_IGNORED) {
/* skipHours, skipDays common but IGNORED */
RAPTOR_DEBUG2("Ignoring fields for type %s\n", raptor_rss_types_info[rss_parser->current_type].name);
redland/raptor/src/raptor_rss.c view on Meta::CPAN
if(rss_parser->current_type == RAPTOR_RSS_ITEM)
update_item=rss_parser->model.last;
else
update_item=raptor_rss_model_get_common(&rss_parser->model,
rss_parser->current_type);
/* if value is always an uri, make it so */
if(raptor_rss_fields_info[rss_parser->current_field].flags &
RAPTOR_RSS_INFO_FLAG_URI_VALUE) {
RAPTOR_DEBUG4("Added URI %s to field %s of type %s\n", cdata, raptor_rss_fields_info[rss_parser->current_field].name, raptor_rss_types_info[rss_parser->current_type].name);
field->uri=raptor_new_uri_relative_to_base(base_uri, cdata);
} else {
RAPTOR_DEBUG4("Added text '%s' to field %s of type %s\n", cdata, raptor_rss_fields_info[rss_parser->current_field].name, raptor_rss_types_info[rss_parser->current_type].name);
field->uri=NULL;
field->value=(unsigned char*)RAPTOR_MALLOC(cstring, cdata_len+1);
strncpy((char*)field->value, (const char*)cdata, cdata_len);
field->value[cdata_len]='\0';
}
RAPTOR_DEBUG1("fa3 - ");
raptor_rss_item_add_field(update_item, rss_parser->current_field, field);
}
} /* end if contained cdata */
if(raptor_xml_element_is_empty(xml_element)) {
/* Empty element, so consider adding one of the attributes as
* literal or URI content
*/
if(rss_parser->current_type >= RAPTOR_RSS_COMMON_IGNORED) {
/* skipHours, skipDays common but IGNORED */
RAPTOR_DEBUG3("Ignoring empty element %s for type %s\n", name, raptor_rss_types_info[rss_parser->current_type].name);
} else if(rss_element->uri) {
redland/raptor/src/raptor_rss.c view on Meta::CPAN
tidy_end_element:
if(rss_element)
raptor_free_rss_element(rss_element);
}
static void
raptor_rss_cdata_handler(void *user_data, raptor_xml_element* xml_element,
const unsigned char *s, int len)
{
raptor_rss_element* rss_element;
rss_element=(raptor_rss_element*)xml_element->user_data;
if(rss_element->xml_writer) {
raptor_xml_writer_cdata_counted(rss_element->xml_writer, s, len);
return;
}
raptor_stringbuffer_append_counted_string(rss_element->sb, s, len, 1);
}
static void
raptor_rss_comment_handler(void *user_data, raptor_xml_element* xml_element,
const unsigned char *s)
redland/raptor/src/raptor_sax2.c view on Meta::CPAN
void
raptor_sax2_set_characters_handler(raptor_sax2* sax2,
raptor_sax2_characters_handler handler)
{
sax2->characters_handler=handler;
}
void
raptor_sax2_set_cdata_handler(raptor_sax2* sax2,
raptor_sax2_cdata_handler handler)
{
sax2->cdata_handler=handler;
}
void
raptor_sax2_set_comment_handler(raptor_sax2* sax2,
raptor_sax2_comment_handler handler)
{
sax2->comment_handler=handler;
}
redland/raptor/src/raptor_sax2.c view on Meta::CPAN
* raptor_xml_element_is_empty:
* @xml_element: XML Element
*
* Check if an XML Element is empty.
*
* Return value: non-0 if the element is empty.
**/
int
raptor_xml_element_is_empty(raptor_xml_element* xml_element)
{
return !xml_element->content_cdata_seen &&
!xml_element->content_element_seen;
}
const unsigned char*
raptor_sax2_inscope_xml_language(raptor_sax2 *sax2)
{
raptor_xml_element* xml_element;
for(xml_element=sax2->current_element;
redland/raptor/src/raptor_sax2.c view on Meta::CPAN
raptor_sax2_characters(void* user_data, const unsigned char *s, int len)
{
raptor_sax2* sax2=(raptor_sax2*)user_data;
if(sax2->characters_handler)
sax2->characters_handler(sax2->user_data, sax2->current_element, s, len);
}
/* like <![CDATA[...]> */
void
raptor_sax2_cdata(void* user_data, const unsigned char *s, int len)
{
raptor_sax2* sax2=(raptor_sax2*)user_data;
#ifdef RAPTOR_XML_EXPAT
#ifdef EXPAT_UTF8_BOM_CRASH
sax2->tokens_count++;
#endif
#endif
if(sax2->cdata_handler)
sax2->cdata_handler(sax2->user_data, sax2->current_element, s, len);
}
/* comment */
void
raptor_sax2_comment(void* user_data, const unsigned char *s)
{
raptor_sax2* sax2=(raptor_sax2*)user_data;
if(sax2->comment_handler)
sax2->comment_handler(sax2->user_data, sax2->current_element, s);