Re: [users@httpd] xml-xsl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My Apologies, my email seems to have messed up the spacing... Try this:
<?php
$xml_string = '<?xml version="1.0"?><test><name>Hello
World</name><notname>me</notname></test>';
$xsl_string = '<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";><xsl:template
match="/"><b><xsl:value-of
select="/test/name"/></b></xsl:template></xsl:stylesheet>';
$xml = DomDocument::loadXML($xml_string);
$xsl = DomDocument::loadXML($xsl_string);
//make a new XSLT Processor
$proc = new xsltprocessor;
// attach the xsl rules
$proc->importStyleSheet($xsl);
$result_string = $proc->transformToXML($xml);
echo $result_string;
?>

I hope it doesn't happen again, there should only be 12 lines of code. The
xml_string and xsl_string should be 1 line each.

-----------------------------
--     Justin Gehring      --
--   PH: 651 - 208 -8797   --
--  EM: justin@xxxxxxxxxxx --
-----------------------------


Quoting Billy Duke <duke011@xxxxxxxxxxxxxx>:

> This is the erro that i got.
>
> Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
> C:\phpdev5\www\test1.php on line 3
>
> Parse error: parse error, unexpected T_STRING in C:\phpdev5\www\test1.php on
> line 3
>
> ----- Original Message -----
> From: "Justin Gehring" <justin@xxxxxxxxxxx>
> To: <users@xxxxxxxxxxxxxxxx>
> Sent: Monday, August 08, 2005 1:16 AM
> Subject: Re: [users@httpd] xml-xsl
>
>
> > I'm still not entirely sure of what you mean... If your looking to test to
> > make
> > sure that it's working with your new setup, please try the following block
> > of
> > code:
> >
> > ///////////////////////////////// Begin Code
> >
> > <?php
> > $xml_string = '<?xml version="1.0"?><test><name>Hello
> > World</name><notname>me</notname></test>';
> > $xsl_string = '<xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";><xsl:template
> > match="/"><b><xsl:value-of select="/test/name"
> > /></b></xsl:template></xsl:stylesheet>';
> > $xml = DomDocument::loadXML($xml_string);
> > $xsl = DomDocument::loadXML($xsl_string);
> > //make a new XSLT Processor
> > $proc = new xsltprocessor;
> > // attach the xsl rules
> > $proc->importStyleSheet($xsl);
> > $result_string = $proc->transformToXML($xml);
> > echo $result_string;
> > ?>
> >
> > //////////////////// End Code
> >
> >
> > You should get Hello World back with bold tags. If you get me back or an
> > error,
> > something is wrong. Let us know what happens.
> >
> > My Apologies to the group, this might be a little off topic from Apache.
> >
> > -----------------------------
> > --     Justin Gehring      --
> > --   PH: 651 - 208 -8797   --
> > --  EM: justin@xxxxxxxxxxx --
> > -----------------------------
> >
> >
> > Quoting Billy Duke <duke011@xxxxxxxxxxxxxx>:
> >
> >> I am seeing the xml and the xsl. the php is working fine as far as i can
> >> see.
> >> ----- Original Message -----
> >> From: "Justin Gehring" <justin@xxxxxxxxxxx>
> >> To: <users@xxxxxxxxxxxxxxxx>
> >> Sent: Monday, August 08, 2005 12:12 AM
> >> Subject: Re: [users@httpd] xml-xsl
> >>
> >>
> >> > What code are you seeing? The php? The XML? The XSL?
> >> >
> >> > -----------------------------
> >> > --     Justin Gehring      --
> >> > --   PH: 651 - 208 -8797   --
> >> > --  EM: justin@xxxxxxxxxxx --
> >> > -----------------------------
> >> >
> >> >
> >> > Quoting Billy Duke <duke011@xxxxxxxxxxxxxx>:
> >> >
> >> >> I had allot of problems getting sablotron to work so I decided to
> >> >> install
> >> >> apache2 and php5 instead of the older versions. I am assuming from
> >> >> others
> >> >> posting that I shouldn't need sablotron now. But now I am still having
> >> >> some
> >> >> of the same problems. When I try to view the XML/XSL web pages I only
> >> >> see
> >> >> the code. What can I do? Please help.
> >> >>
> >> >> Billy
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> The official User-To-User support forum of the Apache HTTP Server
> >> >> Project.
> >> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> >> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >> >>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> >> >> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > The official User-To-User support forum of the Apache HTTP Server
> >> > Project.
> >> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >> >   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> >> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> The official User-To-User support forum of the Apache HTTP Server
> >> Project.
> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> >> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux