XSLTInputSource Xalan - build from String ?

Hi,

could anyone help me the following problem:

It looks that it is impossible to create XSLTInputSource (XALAN C++
implementation) for anything other than file?
Is it true?

I need to read/write from string or from stream for instance but as far as I
see from sources these constructors are not implemented.
Is it possible with XALAN?
or with any other parser MSXML for instance

Could you please provide me with some sample code or point to any
informative source?

Looking for help
Martin
martinmoessnerAsked:
Who is Participating?
 
_corey_Commented:
Martin,

  They are actually implemented in the source.  What you're seeing is simply no code in the method body.

  However, C++ allows you to initialize variables and inherited class constructors in a comma-separated list before the first method body bracket.  This is the best way I can think to explain it.

  You'll see that XSLTInputSource actually inherits InputSource, so this is calling InputSource's constructor with no parameters.  Then, m_stream and m_node member variables are initialized by the value in the parentheses.  This appears to setup the XSLTInputSource object just fine.

XSLTInputSource::XSLTInputSource(StreamType*      stream) :
      InputSource(),
      m_stream(stream),
      m_node(0)
{
}



XSLTInputSource::XSLTInputSource(StreamType&      stream) :
      InputSource(),
      m_stream(&stream),
      m_node(0)
{
}

corey
0
 
jkrCommented:
>>for anything other than file?

There seems to be a misunderstanding - 'istream' does not necessarily have to represent a file, it can be anything that fits an input stream buffer like 'istream', such as e.g. a 'istrstream'- see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/HTML/_iostream_input_streams.asp ("Input Streams")

Apart from that: I don't know XALAN, but according to http://xml.apache.org/xalan-c/apidocs/classXSLTInputSource.html , there are a couple of other constructors available, namely

# XSLTInputSource (const XMLCh *systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const XalanDOMString &systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const char *systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const char *systemId, const char *publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (const XMLCh *systemId, const XMLCh *publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (const XalanDOMString &systemId, const XalanDOMString &publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (XalanNode *node)

    Create a new input source with a DOM node.

# XSLTInputSource (StreamType *stream)

    Create a new input source with std stream.



0
 
waysideCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: corey

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

wayside
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.