You are on page 1of 12

Fiberlink Software Pvt. Ltd.

Design Document
for

Development of APIs for XML to WBXML


Conversion and WBXML to XML for ActiveSync

Version 00.01
Date :21-Jan-2014>

Project ID: 14-237

Design Document

Approval

Design Document
Document
Version

00.01

Prepared by
Name / Signature

Reviewed by
Date

Name / Signature

Approved By
Date

Name / Signature

Date

Gunjan K
Sahu

This document is the property of Integra Micro Systems Pvt. Ltd., and its contents are confidential to Integra Micro Systems.
Reproduction of the materials contained herein, in part or full in any form by anyone, without the permission of Integra Micro
Systems is prohibited.

Proprietary and Confidential

<Version 00.01>

Project ID: 14-237

Design Document

Revision History
Version
Number

Brief description of change

Proprietary and Confidential

Reference for
change

<Version 00.01>

Affected
Section(s)

Effective Date

ii

Project ID: 14-237

Design Document

TABLE OF CONTENTS
1 INTRODUCTION......................................................................................................................................1
1.1 PURPOSE..................................................................................................................................................1
1.2 SCOPE......................................................................................................................................................1
1.3 REFERENCES............................................................................................................................................1
2 DETAILED DESIGN CONSIDERATIONS.............................................................................................1
2.1 ALGORITHMS...........................................................................................................................................2
2.2 CODING GUIDELINES AND CONVENTIONS...............................................................................................2
3 DECOMPOSITION DESCRIPTION .......................................................................................................2
3.1 XML TO WBXML CONVERTER ARCHITECTURE...................................................................................2
.........................................................................................................................3
3.1.1 Identification ..................................................................................................................................4
3.1.2 Type.................................................................................................................................................4
3.1.3 Purpose............................................................................................................................................4
3.1.4 Function..........................................................................................................................................4
3.1.5 Composition....................................................................................................................................4
3.1.6 Component Descriptions.................................................................................................................4
Component Name...............................................................................................................................................4
3.1.6.1.1 Interfaces..........................................................................................................................................4
3.1.6.2 Processing................................................................................................................................................5
3.1.6.3 Data......................................................................................................................................................... 6

3.2 <MODULE 2>..........................................................................................................................................6


3.2.1 Identification ..................................................................................................................................6
3.2.2 Type.................................................................................................................................................6
3.2.3 Purpose............................................................................................................................................6
3.2.4 Function..........................................................................................................................................6
3.2.5 Composition....................................................................................................................................6
3.2.6 Component Descriptions.................................................................................................................6
3.2.6.1 Component Name....................................................................................................................................6
3.2.6.1.1 Interfaces..........................................................................................................................................6
3.2.6.2 Processing................................................................................................................................................6
3.2.6.3 Data......................................................................................................................................................... 6

Proprietary and Confidential

<Version 00.01>

iii

Project ID: 14-237

Design Document

Introduction

This document describes the design level details of the xml to wbxml conversion
and wbxml to xml conversion for ActiveSync code pages 14.0
1.1

Purpose
The purpose of the document is

1.2

To translate the requirements stated in HLD & SRS into a format amenable
for coding.

To form the basis for Unit Test Plan.

Scope
This document identifies the design level components of xml to wbxml conversion and
wbxml to xml conversion.

1.3

References
SOW- ActiveSync XML to WBXML Conversion.docx
ActiveSync Code Pages 14.0
http://www.w3.org/1999/06/NOTE-wbxml-19990624/
http://www.iana.org/assignments/character-sets/character-sets.xml

Detailed Design Considerations


This section describes the design components and the corresponding algorithms used for
implementing the xml to wbxml conversion and wbxml to xml conversion .

Proprietary and Confidential

<Version 00.01>

Page 1

Project ID: 14-237

2.1

Design Document

Algorithms
Please follow http://www.w3.org/1999/06/NOTE-wbxml-19990624/

2.2

Coding guidelines and Conventions


For coding conventions and guidelines, please follow the coding standard documentation
(Coding Standards for the C Language) that is available at QMS location

http://182.72.231.117:3495/Quality/v3.20/ToC_Codingstandards.html

3
3.1

Decomposition Description
XML to WBXML Converter Architecture

Proprietary and Confidential

<Version 00.01>

Page 2

Conv_xml_wbxml ( xml, xml len, wbxml. wbxml len)


Project
ID: 14-237
{

Design Document

Prepare the ActiveSync Dictionary.


Set handler function for xml_parse.
(Handle_Start_Element, Handle_End_Element, Handle_Data)
XML_Parse() ;
}

Xml Error ?
Yes

Return with Error

No

Put the appropiate


value In the wbxml
buffer

End Element

Coninue
till
last token and
check
each
token type and
call
corresponding
hendler

Data

Put data in wbxml buffer


In hexa form

Start Element
Handle_Start_Element()
{
Check namespace with current namespace. If namespace differ, get the name space value from code pages
value from dictionary.
Find_Element();
Check the attribute presence by caling Handle_Attribute()
Put the code pages value if it is changed in wbxml buffer
Put the element value in wbxml buffer.
Put attribute value in the wbxml buffer if present.
}

Proprietary and Confidential

<Version 00.01>

Page 3

Project ID: 14-237

3.1.1

Design Document

Identification
Xml to wbxml converter

3.1.2

Type
C Functions

3.1.3

Purpose
To convert xml to wbxml referring ActiveSync code pages.

3.1.4

Function
This will take input as xml data and xml data length and convert to wbxml and give output
as wbxml data and wbxml data length.

3.1.5

Composition
Following section describes the list of APIs which are used to convert xml to
wbxml..

3.1.6

Component Descriptions
Xml to wbxml converter APIs are user defined C functions and some APIs are provided
by expat xml parser library.

Component Name
Xml to wbxml converter

3.1.6.1.1

Interfaces

Int Conv_xml_wbxml( char *xml, int len, char **wbxml. Int *len)
This function will be called by application to convert xml to wbxml. Input will be
xml , xml length and output will be wbxml, wbxml length.On successfull it returns
0, else return error code.
3.1.6.1.2
void Handle_Start_Element(void *data, const char *element, const char
**attribute)
This is a callback function called by expat library to handle xml open tag .

3.1.6.1.3
void Handle_End_Element(void *data, const char *el)
This is a callback function called by expat library to handle xml close tag.

Proprietary and Confidential

<Version 00.01>

Page 4

Project ID: 14-237

Design Document

3.1.6.1.4
Void Handle_Data(void *data, const char *constant, int length)
This is a callback function called by expat library to handle data between xml
tag.
3.1.6.1.5
Int Handle_Attribute(const char *element, const char **attribute)
This will handle attributes for xml element which will get called inside
Handle_Start_Element.This will return 0 (Zero) on successfull and on error return
error code.
3.1.6.1.6
int Find_Tag(const char *element, int codepage, int *tagvalue)
This will search the tag name in the dictionary in the input codepages and give
output as its hexa value . Return 0 on success and on error return error code.
3.1.6.1.7
int Find_Codepage(const char *namespacename, int *codepages)
This will find the code page in the dictionary and give output as its decimal value.
On successfull return 0, on error return error code.
3.1.6.1.8
int XML_Parse(XML_parse, char *xml, int len, int isFinal)
This will parse the xml which is defined in expat library. This will take different call
back functions to handle xml elements.
3.1.6.1.9
Void Wbxml_Prepare_Output(char *data)
This function will insert wbxml header and prepare wbxml output.
3.1.6.2

Processing
Client will call Conv_xml_wbxml() function will necessary input. This function will set
handler function required by XML_Parse() function to handle open tag, end tag and data
between tag. Inside Handle_Start_Element() function this will check the namespace. If
the name space is not same with current name space, it will search namespace in code
pages dictionary and get the value. Then it will search the tag name and for that code
page and get the vaule. After that this function will call Handle_Attribute() to check and
handle the attributes. After all these step it will calculate the value for that partucar
element and put into a buffer along with its attributes value (if any) . For end tag, it will fill
the value 0x01. For data, it will copy its hexa value into the buffer.
Atlast it will Wbxml_Prepare_Output() function will insert the buffer and create final
wbxml.

Proprietary and Confidential

<Version 00.01>

Page 5

Project ID: 14-237

3.1.6.3

Design Document

Data
ActiveSync Code page 14.0

3.2

<Module 2>

3.2.1

Identification
<The name of the entity. Two entities should not have the same name.>

3.2.2

Type
<A description of the kind of the entity. The type attribute shall describe the nature of the entity. It
can be a subsystem, module, class, package, function, file, etc.>

3.2.3

Purpose
<A description of why the entity exists. >

3.2.4

Function
<The primary responsibilities and or behavior of this component. What does this component
accomplish? What roles does it play? What kinds of services it provide to its clients>

3.2.5

Composition
<A description of the use and meaning of the components that are a part of this module>

3.2.6

Component Descriptions

3.2.6.1

Component Name
<the component name can be the class name, file name, etc under this module.>

3.2.6.1.1

Interfaces

<The set of services (resources, data, types, constants, subroutines and exceptions) that are
provided by this component. The precise definition or declaration of each component should be
present along the comments or annotations describing the meaning of values, parameters, etc.>
3.2.6.2

Processing
<A description of precisely how this component goes about performing the duties necessary to
fulfill its responsibilities. This should encompass a description of any algorithms used, changes of
state, space complexity, concurrency, methods of creation, initialization, clean up, and handling of
exceptional conditions>

3.2.6.3

Data
<A description of data elements internal to the component. The data attribute shall be the method
of representation, initial values, use, semantics, format, and acceptable values of internal data.
The description of the data may be in the form of a data dictionary that describes the content,
structure and use of all data elements. It shall include data specifications such as formats, number
of elements, and initial values. It shall also include the structures used for representing the data
such as file structures, arrays, stacks, queues, and memory partitions.>

Proprietary and Confidential

<Version 00.01>

Page 6

Project ID: 14-237

Design Document

< ADD AS MANY SUB-SECTIONS IN SECTION 3.2.6 AS THE NUMBER OF components


under this module >

< ADD AS MANY SUB-SECTIONS IN SECTION 3 AS THE NUMBER OF MODULES >

Proprietary and Confidential

<Version 00.01>

Page 7

Project ID: 14-237

Proprietary and Confidential

Design Document

<Version 00.01>

Page 8

You might also like